mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-10 22:17:13 -06:00
UIDefaultsLoader: added over() color function to convert a translucent color into a solid color based on any background color
This commit is contained in:
@@ -482,6 +482,10 @@ class FlatCompletionProvider
|
||||
"dark", colorParamDesc,
|
||||
"light", colorParamDesc,
|
||||
"threshold", "(optional) 0-100%, default is 43%" );
|
||||
|
||||
addFunction( "over",
|
||||
"foreground", colorParamDesc,
|
||||
"background", colorParamDesc );
|
||||
}
|
||||
|
||||
private void addFunction( String name, String... paramNamesAndDescs ) {
|
||||
|
||||
@@ -76,6 +76,7 @@ public class FlatThemeTokenMaker
|
||||
tokenMap.put( "tint", TOKEN_FUNCTION );
|
||||
tokenMap.put( "shade", TOKEN_FUNCTION );
|
||||
tokenMap.put( "contrast", TOKEN_FUNCTION );
|
||||
tokenMap.put( "over", TOKEN_FUNCTION );
|
||||
|
||||
// function options
|
||||
tokenMap.put( "relative", Token.RESERVED_WORD );
|
||||
|
||||
@@ -118,6 +118,12 @@ Prop.6.selectionForeground = contrast($Prop.6.selectionBackground,#000,#fff)
|
||||
Prop.7.selectionBackground = #FF9500
|
||||
Prop.7.selectionForeground = contrast($Prop.7.selectionBackground,#000,#fff)
|
||||
|
||||
Prop.colorFunc60 = over(#fff8,#f00)
|
||||
Prop.colorFunc61 = over(#fff8,#0f0)
|
||||
Prop.colorFunc62 = over(#f000,#0f0)
|
||||
Prop.colorFunc63 = over(#f00,#0f0)
|
||||
Prop.colorFunc64 = over(#f008,null)
|
||||
|
||||
|
||||
|
||||
@varStyle1 = #f0f
|
||||
|
||||
Reference in New Issue
Block a user