mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-11 06:27:13 -06:00
UIDefaultsLoader: added systemColor() color function that can be used to change accent color (preparation for getting accent color from operating system)
This commit is contained in:
@@ -410,6 +410,10 @@ class FlatCompletionProvider
|
||||
addFunction( "lazy",
|
||||
"uiKey", "UI key (without leading '$')" );
|
||||
|
||||
addFunction( "systemColor",
|
||||
"name", "system color name",
|
||||
"defaultValue", "default color value used if system color is not available" );
|
||||
|
||||
addFunction( "rgb",
|
||||
"red", "0-255 or 0-100%",
|
||||
"green", "0-255 or 0-100%",
|
||||
|
||||
@@ -56,6 +56,7 @@ public class FlatThemeTokenMaker
|
||||
tokenMap.put( "lazy", TOKEN_FUNCTION );
|
||||
|
||||
// color functions
|
||||
tokenMap.put( "systemColor", TOKEN_FUNCTION );
|
||||
tokenMap.put( "rgb", TOKEN_FUNCTION );
|
||||
tokenMap.put( "rgba", TOKEN_FUNCTION );
|
||||
tokenMap.put( "hsl", TOKEN_FUNCTION );
|
||||
|
||||
@@ -49,6 +49,9 @@ Prop.ifColor = lighten(if(#000,#0f0,#dfd), 10%)
|
||||
Prop.ifColorVar = lighten(if(@varTrue,@varTrueValue,@varFalseValue), 10%)
|
||||
Prop.lazy = lazy(Prop.string)
|
||||
|
||||
Prop.systemColor1 = systemColor(accent,null)
|
||||
Prop.systemColor2 = systemColor(accent,#f00)
|
||||
|
||||
Prop.colorFunc1 = rgb(12,34,56)
|
||||
Prop.colorFunc2 = rgba(12,34,56,78)
|
||||
Prop.colorFunc3 = hsl(12,34%,56%)
|
||||
|
||||
Reference in New Issue
Block a user