ColorX extension

on

Properties

complementary → Color

Available on Color, provided by the ColorX extension

no setter
contrastText → Color

Available on Color, provided by the ColorX extension

no setter
greyscale → Color

Available on Color, provided by the ColorX extension

no setter
hue → double

Available on Color, provided by the ColorX extension

Hue in degrees, 0 to 360.
no setter
isDark → bool

Available on Color, provided by the ColorX extension

no setter
isLight → bool

Available on Color, provided by the ColorX extension

no setter
isOpaque → bool

Available on Color, provided by the ColorX extension

Whether this color is fully opaque.
no setter
isTransparent → bool

Available on Color, provided by the ColorX extension

Whether this color is fully transparent.
no setter
lightness → double

Available on Color, provided by the ColorX extension

Lightness in [0, 1].
no setter
opaque → Color

Available on Color, provided by the ColorX extension

This color at full opacity.
no setter
saturation → double

Available on Color, provided by the ColorX extension

Saturation in [0, 1].
no setter
splitComplementary → (Color, Color)

Available on Color, provided by the ColorX extension

no setter
tetradic → (Color, Color, Color)

Available on Color, provided by the ColorX extension

no setter
triadic → (Color, Color)

Available on Color, provided by the ColorX extension

no setter

Methods

analogous({int count = 2, double spreadDegrees = 30}) → List<Color>

Available on Color, provided by the ColorX extension

Returns 2 * count analogous colors: count steps to the left and count to the right of this color on the hue wheel, interleaved as left1, right1, left2, right2, ….
bestContrast([List<Color> candidates = const [Colors.white, Colors.black]]) → Color

Available on Color, provided by the ColorX extension

Picks the highest-contrast color from candidates (defaults to white/black).
contrastRatio(Color other) → double

Available on Color, provided by the ColorX extension

darken([double amount = ColorMath.defaultAmount]) → Color

Available on Color, provided by the ColorX extension

desaturate([double amount = ColorMath.defaultAmount]) → Color

Available on Color, provided by the ColorX extension

lighten([double amount = ColorMath.defaultAmount]) → Color

Available on Color, provided by the ColorX extension

meetsWcagAA(Color background) → bool

Available on Color, provided by the ColorX extension

meetsWcagAAA(Color background) → bool

Available on Color, provided by the ColorX extension

mix(Color other, [double t = 0.5]) → Color

Available on Color, provided by the ColorX extension

Linearly interpolates toward other. t = 0 returns this color; t = 1 returns other.
monochromatic({int count = 5}) → List<Color>

Available on Color, provided by the ColorX extension

A same-hue lightness ramp. See ColorMath.monochromatic.
saturate([double amount = ColorMath.defaultAmount]) → Color

Available on Color, provided by the ColorX extension

shade([double amount = 0.5]) → Color

Available on Color, provided by the ColorX extension

tint([double amount = 0.5]) → Color

Available on Color, provided by the ColorX extension

toCssRgba({int alphaPrecision = 2}) → String

Available on Color, provided by the ColorX extension

CSS rgba(...) notation.
toHexARGB({bool withHashSign = true}) → String

Available on Color, provided by the ColorX extension

8-char ARGB: #CCFF5500.
toHexRGB({bool withHashSign = true}) → String

Available on Color, provided by the ColorX extension

6-char RGB: #FF5500.
toMaterialColor() → MaterialColor

Available on Color, provided by the ColorX extension

withAlphaOpacity(double opacity) → Color

Available on Color, provided by the ColorX extension

withHue(double value) → Color

Available on Color, provided by the ColorX extension

Returns this color with its hue replaced. Wraps values outside 0–360.
withLightness(double value) → Color

Available on Color, provided by the ColorX extension

Returns this color with its lightness replaced, clamped to [0, 1].
withSaturation(double value) → Color

Available on Color, provided by the ColorX extension

Returns this color with its saturation replaced, clamped to [0, 1].