ChromaKit extension
ChromaKit provides a robust set of utilities for dynamic color manipulation in Flutter.
This extension handles common design challenges such as creating pastel shades, ensuring accessibility contrast, and safe hex parsing.
- on
Properties
- contrastColor → Color
-
Available on Color, provided by the ChromaKit extension
Returns Colors.black or Colors.white depending on the color's brightness.no setter - isDark → bool
-
Available on Color, provided by the ChromaKit extension
Checks if the color is dark based on its luminance value.no setter
Methods
-
darken(
[double factor = 0.1]) → Color - Darkens the color by blending it with black.
-
faint(
[double factor = 0.9]) → Color - Blends the color with pure white to create a solid pastel tint.
-
faintWith(
Color other, [double factor = 0.9]) → Color -
Available on Color, provided by the ChromaKit extension
Blends the color with a specificothercolor. -
faintWiths(
List< Color> others, [double factor = 0.9]) → Color -
Available on Color, provided by the ChromaKit extension
Blends the color with the calculated average of a list ofothers. -
lighten(
[double factor = 0.1]) → Color - Lightens the color by blending it with white.
-
toHex(
{bool includeHash = true}) → String - Returns the color in Hexadecimal string format (e.g., #FF6200EE).
-
transparency(
double fraction) → Color -
Available on Color, provided by the ChromaKit extension
Adjusts the alpha channel of the color based on afraction. -
withOpacityFraction(
double fraction) → Color -
Available on Color, provided by the ChromaKit extension
An alias for opacity for backward compatibility.