mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-13 23:37:13 -06:00
UIDefaultsLoader: added mix() color function (inspired by Less CSS)
This commit is contained in:
@@ -370,6 +370,11 @@ class FlatCompletionProvider
|
||||
addFunction( "changeSaturation", hslChangeParams );
|
||||
addFunction( "changeLightness", hslChangeParams );
|
||||
addFunction( "changeAlpha", hslChangeParams );
|
||||
|
||||
addFunction( "mix",
|
||||
"color1", colorParamDesc,
|
||||
"color2", colorParamDesc,
|
||||
"weight", "(optional) 0-100%, default is 50%" );
|
||||
}
|
||||
|
||||
private void addFunction( String name, String... paramNamesAndDescs ) {
|
||||
|
||||
@@ -68,6 +68,7 @@ public class FlatThemeTokenMaker
|
||||
tokenMap.put( "changeSaturation", TOKEN_FUNCTION );
|
||||
tokenMap.put( "changeLightness", TOKEN_FUNCTION );
|
||||
tokenMap.put( "changeAlpha", TOKEN_FUNCTION );
|
||||
tokenMap.put( "mix", TOKEN_FUNCTION );
|
||||
tokenMap.put( "lazy", TOKEN_FUNCTION );
|
||||
|
||||
// function options
|
||||
|
||||
@@ -54,3 +54,11 @@ Prop.colorFunc20 = changeHue(#f00,180)
|
||||
Prop.colorFunc21 = changeSaturation(#f00,50%)
|
||||
Prop.colorFunc22 = changeLightness(#f00,80%)
|
||||
Prop.colorFunc23 = changeAlpha(#f00,50%)
|
||||
|
||||
Prop.colorFunc30 = mix(#f00,#0f0,10%)
|
||||
Prop.colorFunc31 = mix(#f00,#0f0,25%)
|
||||
Prop.colorFunc32 = mix(#f00,#0f0)
|
||||
Prop.colorFunc33 = mix(#f00,#0f0,75%)
|
||||
Prop.colorFunc34 = mix(#f00,#0f0,90%)
|
||||
Prop.colorFunc35 = mix($Prop.color1,$Prop.color2)
|
||||
Prop.colorFunc36 = mix($Prop.colorFunc20,$Prop.colorFunc30)
|
||||
|
||||
Reference in New Issue
Block a user