@mantine/core package exports several functions that can be used to manipulate colors
or extract information before using them as CSS value.
lighten functions can be used to manipulate color brightness,
they accept color in any format as first argument and the amount of lightness to add/remove as second argument.
rgba function converts color to rgba format with a given alpha channel,
it is usually used to make colors more transparent:
parseThemeColor function returns information about a given color in the following format:
getThemeColor is a simpler version of
parseThemeColor function, it accepts a color string
as first argument and theme object as second argument. It returns parsed color value or CSS variable:
getGradient function transforms given
MantineGradient object to CSS gradient string:
isLightColor function can be used to achieve better contrast between text and background: