@@ -271,7 +271,10 @@ def setup_gamut_options(self):
271271
272272 self .show_out_of_gamut_preview = ch_settings .get ('show_out_of_gamut_preview' , True )
273273 self .gamut_space = ch_settings .get ('gamut_space' , 'srgb' )
274- self .gamut_map = ch_settings .get ('gamut_map' , 'lch-chroma' )
274+ gmap = ch_settings .get ('gamut_map' , {'method' : 'minde-chroma' , 'pspace' : 'lch-d65' })
275+ if isinstance (gmap , str ):
276+ gmap = {'method' : gmap }
277+ self .gamut_map = gmap
275278 if self .gamut_space not in util .GAMUT_SPACES :
276279 self .gamut_space = 'srgb'
277280 self .out_of_gamut = self .base ("transparent" ).convert (self .gamut_space )
@@ -437,7 +440,7 @@ def do_search(self, force=False):
437440 mdpopups .scope2style (self .view , self .view .scope_name (pt ))['background' ]
438441 ).convert ("hsl" )
439442 hsl ['lightness' ] = hsl ['lightness' ] + (0.3 if hsl .luminance () < 0.5 else - 0.3 )
440- preview_border = hsl .convert (self .gamut_space , fit = self .gamut_map ).set ('alpha' , 1 )
443+ preview_border = hsl .convert (self .gamut_space ). fit ( ** self .gamut_map ).set ('alpha' , 1 )
441444
442445 color = self .base (obj .color )
443446 title = ''
@@ -448,15 +451,15 @@ def do_search(self, force=False):
448451 if not color .in_gamut (check_space ):
449452 title = ' title="Preview out of gamut"'
450453 if self .show_out_of_gamut_preview :
451- pcolor = color .convert (self .gamut_space , fit = self .gamut_map )
454+ pcolor = color .convert (self .gamut_space ). fit ( ** self .gamut_map )
452455 preview1 = pcolor .clone ().set ('alpha' , 1 )
453456 preview2 = pcolor
454457 else :
455458 preview1 = self .out_of_gamut
456459 preview2 = self .out_of_gamut
457460 preview_border = self .out_of_gamut_border
458461 else :
459- pcolor = color .convert (self .gamut_space , fit = self .gamut_map )
462+ pcolor = color .convert (self .gamut_space ). fit ( ** self .gamut_map )
460463 preview1 = pcolor .clone ().set ('alpha' , 1 )
461464 preview2 = pcolor
462465
0 commit comments