@@ -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 :
0 commit comments