OkHsl class

Represents a color in the HSL (Hue, Saturation, Lightness) color space. h: Hue, in range 0, 1 representing 0 to 360 degrees s: Saturation, in range 0, 1 l: Lightness, in range 0, 1 Example usage: HSL hsl = srgbToOkhsl(RGB(0.5, 0.5, 0.5)); // Hue is used in trigonometric functions: double a_ = math.cos(2 * math.pi * hsl.h); double b_ = math.sin(2 * math.pi * hsl.h);

Constructors

OkHsl(double h, double s, double l)
OkHsl.fromColor(Color color)
factory

Properties

h double
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
l double
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
s double
getter/setter pair

Methods

analogous({int count = 2, double angle = 30}) List<OkHsl>
complementary() OkHsl
copyWith({double? hue, double? saturation, double? lightness}) OkHsl
darker(double percentage) OkHsl
desaturate(double percentage) OkHsl
lighter(double percentage) OkHsl
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
rotated(double degrees) OkHsl
saturate(double percentage) OkHsl
shades({int count = 5}) List<OkHsl>
splitComplementary() List<OkHsl>
tetradic() List<OkHsl>
tints({int count = 5}) List<OkHsl>
toColor() Color
toString() String
A string representation of this object.
override
triadic() List<OkHsl>
withHue(double hue) OkHsl
withLightness(double lightness) OkHsl
withSaturation(double saturation) OkHsl

Operators

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

Static Methods

lerp(OkHsl a, OkHsl b, double t, {bool shortestPath = true}) OkHsl