contrast(color,background)¶
Definition¶
String contrast(String color, String background)
Description¶
Returns #000000 or #FFFFFF, whichever is more legible on top of the supplied color. Colors are in #RRGGBB format. Returns null if the color argument is null or unparseable. Supply the background color when the first color is translucent, so the two are blended before the choice is made.
Parameter Definition¶
| Name | Type | Description |
|---|---|---|
| color | String | Color that the text or shape will be drawn on top of, in rrggbb format |
| background | String | Color behind the first one, used only when the first color has alpha. Leave as empty string when the fill is opaque or the backdrop is unknown |