File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
src/core/generator/clones/utils/color Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -109,6 +109,16 @@ export const replacementMap = (baseColor: string, colors: Set<string>) => {
109109 const color = chroma ( orderedColors [ i ] ) ;
110110 let newColor = color . set ( 'hsl.h' , baseHue ) ;
111111
112+ // if it's a simple, 2-color icon, we also retain the saturation
113+ // from the base color. This helps us better adhere to the
114+ // same-palette rule in the extension's guidelines; keeping both
115+ // colors within the same "color column" of the material palette.
116+ // This mainly affects folder icons, which usually have 2-color
117+ // designs.
118+ if ( orderedColors . length === 2 ) {
119+ newColor = newColor . set ( 'hsl.s' , baseColorChroma . get ( 'hsl.s' ) ) ;
120+ }
121+
112122 // the idea is to keep the paths with the same relative darkness
113123 // as the original icon, but with different hues. So if the
114124 // new color results in a darker color (as we are looping from
You can’t perform that action at this time.
0 commit comments