ColorX extension

Color manipulation and conversion extensions.

on

Properties

complementary → Color

Available on Color, provided by the ColorX extension

Returns the complementary color (180° hue rotation).
no setter
contrastText → Color

Available on Color, provided by the ColorX extension

The most readable monochrome text color for this background.
no setter
isDark → bool

Available on Color, provided by the ColorX extension

Whether the color is perceptually dark.
no setter
isLight → bool

Available on Color, provided by the ColorX extension

Whether the color is perceptually light.
no setter

Methods

darken([double amount = 0.1]) → Color

Available on Color, provided by the ColorX extension

Darkens the color by amount (0..1).
lighten([double amount = 0.1]) → Color

Available on Color, provided by the ColorX extension

Lightens the color by amount (0..1).
mixWith(Color other, [double amount = 0.5]) → Color

Available on Color, provided by the ColorX extension

Blends this color with other by amount (0..1).
rotateHue(double degrees) → Color

Available on Color, provided by the ColorX extension

Rotates the hue by degrees.
toHex({bool withAlpha = true}) → String

Available on Color, provided by the ColorX extension

Converts to an 8-digit hex string #AARRGGBB.
toMaterialColor() → MaterialColor

Available on Color, provided by the ColorX extension

Creates a MaterialColor swatch from this color.
withAlphaFraction(double fraction) → Color

Available on Color, provided by the ColorX extension

Applies an alpha fraction relative to the current alpha.
withOpacity(double opacity) → Color

Available on Color, provided by the ColorX extension

Returns this color with opacity (0..1) applied.