ColourSpace class sealed

The sealed base class for all colour space representations in Collect.

Every colour space (Colour, HSVColour, HSLColour) extends ColourSpace and implements the three conversion methods, so you can freely convert between any pair of colour spaces.

ColourSpace anyColour = someHSVColour;
final rgb = anyColour.toColour();
final hsl = anyColour.toHSL();
Implementers

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toColour() Colour
Converts this colour to its Colour (ARGB) representation.
toHSL() HSLColour
Converts this colour to its HSLColour representation.
toHSV() HSVColour
Converts this colour to its HSVColour representation.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

colorFromHue(double alpha, double hue, double chroma, double secondary, double match) Color
Same as colourFromHue but returns a Flutter Color instead of a Colour. Used internally where the Flutter type is needed directly.
colourFromHue(double alpha, double hue, double chroma, double secondary, double match) Colour
Constructs a Colour from hue, chroma, secondary component, and match offset values. This is the core algorithm that maps HSL/HSV parameters back to RGB.
getHue(double red, double green, double blue, double max, double delta) double
Calculates the hue (0-360 degrees) from normalised RGB components.