Skip to main content
Colors written as CSS writes them, checked on strings.
Theme.kt

hexColor

hexColor() on String Checks that the string is a hexadecimal color: # and 3, 4, 6 or 8 hexadecimal digits, such as #fff or #1a2b3c80. hexColor

rgbColor

rgbColor() on String Checks that the string is a CSS rgb() or rgba() color, such as rgb(255, 0, 0) or rgba(0, 0, 0, 0.5). Each channel is a whole number from 0 to 255, and the alpha from 0 to 1. rgbColor

hslColor

hslColor() on String Checks that the string is a CSS hsl() or hsla() color, such as hsl(120, 100%, 50%). The hue goes from 0 to 360, saturation and lightness from 0% to 100%, and the alpha from 0 to 1. hslColor