core/colour/colour library

Colour classes that work anywhere Flutter's colours do, with extra constructors, conversions and formats.

  • Colour is an RGB colour that can be used as a Color.
  • HSVColour describes a colour by hue, saturation and value (brightness), and can be used as an HSVColor.
  • HSLColour describes a colour by hue, saturation and lightness, and can be used as an HSLColor.

Each can be converted to the others with toColour(), toHSV() and toHSL().

final teal = Colour.fromHex(hexString: '#008080');
final lighter = teal.withLightness(0.6);
Container(color: lighter);

Classes

Colour
An RGB colour with 8-bit channels that can be used anywhere a Flutter Color is expected.
ColourSpace
The shared base of Colour, HSVColour and HSLColour, so any of them can be converted to the others.
HSLColour
A colour described by hue, saturation and lightness, usable anywhere a Flutter HSLColor is expected.
HSVColour
A colour described by hue, saturation and value (brightness), usable anywhere a Flutter HSVColor is expected.

Extensions

Hslcolour on HSLColor
Converts Flutter's HSLColor to HSLColour.
Hsvcolour on HSVColor
Converts Flutter's HSVColor to HSVColour.