Skip to content

Commit fe0ba29

Browse files
committed
Don't use deprecated compose
1 parent bb4f67c commit fe0ba29

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

ch_tool_blend.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ def evaluate(base, string):
126126
colors[0] = first.color.convert(space)
127127
if second:
128128
colors.append(second.color)
129-
colors.append(first.color.compose(second.color, blend=blend_mode, space=space, out_space=space))
129+
colors.append(base.layer([first.color, second.color], blend=blend_mode, space=space, out_space=space))
130130
except Exception:
131131
colors = []
132132
return colors

ch_tool_contrast.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def evaluate(base, string, gamut_map):
121121
colors.append(second.fit('srgb', **gamut_map))
122122
if ratio:
123123
if first[-1] < 1.0:
124-
first = first.compose(second, space="srgb", out_space=first.space())
124+
first = base.layer([first, second], space='srgb', out_space=first.space())
125125
hwb_fg = first.convert('hwb').clip()
126126
hwb_bg = second.convert('hwb').clip()
127127
first.update(hwb_fg)
@@ -140,10 +140,10 @@ def evaluate(base, string, gamut_map):
140140

141141
if first[-1] < 1.0:
142142
# Contrasted with current color
143-
colors.append(first.compose(second, space="srgb", out_space=first.space()))
143+
colors.append(base.layer([first, second], space="srgb", out_space=first.space()))
144144
# Contrasted with the two extremes min and max
145-
colors.append(first.compose("white", space="srgb", out_space=first.space()))
146-
colors.append(first.compose("black", space="srgb", out_space=first.space()))
145+
colors.append(base.layer([first, "white"], space="srgb", out_space=first.space()))
146+
colors.append(base.layer([first, "black"], space="srgb", out_space=first.space()))
147147
else:
148148
colors.append(first)
149149
except Exception as e:

lib/colorbox.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def checkered_color(color, background):
5353
"""Mix color with the checkered color."""
5454

5555
checkered = Color(color)
56-
return checkered.compose(background, space=checkered.space(), out_space=checkered.space())
56+
return Color.layer([checkered, background], space=checkered.space(), out_space=checkered.space())
5757

5858

5959
def get_border_size(direction, border_map):

0 commit comments

Comments
 (0)