mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-10 22:17:13 -06:00
UIDefaultsLoader: added tint() and shade() color functions (inspired by Less CSS)
This commit is contained in:
@@ -371,10 +371,17 @@ class FlatCompletionProvider
|
||||
addFunction( "changeLightness", hslChangeParams );
|
||||
addFunction( "changeAlpha", hslChangeParams );
|
||||
|
||||
String weightParamDesc = "(optional) 0-100%, default is 50%";
|
||||
addFunction( "mix",
|
||||
"color1", colorParamDesc,
|
||||
"color2", colorParamDesc,
|
||||
"weight", "(optional) 0-100%, default is 50%" );
|
||||
"weight", weightParamDesc );
|
||||
addFunction( "tint",
|
||||
"color", colorParamDesc,
|
||||
"weight", weightParamDesc );
|
||||
addFunction( "shade",
|
||||
"color", colorParamDesc,
|
||||
"weight", weightParamDesc );
|
||||
}
|
||||
|
||||
private void addFunction( String name, String... paramNamesAndDescs ) {
|
||||
|
||||
@@ -69,6 +69,8 @@ public class FlatThemeTokenMaker
|
||||
tokenMap.put( "changeLightness", TOKEN_FUNCTION );
|
||||
tokenMap.put( "changeAlpha", TOKEN_FUNCTION );
|
||||
tokenMap.put( "mix", TOKEN_FUNCTION );
|
||||
tokenMap.put( "tint", TOKEN_FUNCTION );
|
||||
tokenMap.put( "shade", TOKEN_FUNCTION );
|
||||
tokenMap.put( "lazy", TOKEN_FUNCTION );
|
||||
|
||||
// function options
|
||||
|
||||
@@ -62,3 +62,11 @@ 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)
|
||||
|
||||
Prop.colorFunc40 = tint(#f0f,25%)
|
||||
Prop.colorFunc41 = tint(#f0f)
|
||||
Prop.colorFunc42 = tint(#f0f,75%)
|
||||
|
||||
Prop.colorFunc45 = shade(#f0f,25%)
|
||||
Prop.colorFunc46 = shade(#f0f)
|
||||
Prop.colorFunc47 = shade(#f0f,75%)
|
||||
|
||||
Reference in New Issue
Block a user