Hsl class

A color representation in the HSL color space.

The Hsl class extends the Color class and represents a color in the HSL (Hue, Saturation, Lightness) color space.

Inheritance

Constructors

Hsl(num h, num s, num l, [num opacity = 1])
Constructs a new HSL color.
Hsl.from(Object? source)
Creates an instance of Hsl color by converting the specified source object.
factory

Properties

h num
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
l num
getter/setter pair
opacity num
This color’s opacity, typically in the range [0, 1].
getter/setter pairinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
s num
getter/setter pair

Methods

brighter([num k = 1]) Hsl
Returns a brighter copy of this color.
override
clamp() Hsl
Returns a new HSL color where the h channel is clamped to the range [0, 360), and the s, l, and opacity channels are clamped to the range [0, 1].
copy() Hsl
Returns a copy of this color.
override
copyWith({num? h, num? s, num? l, num? opacity}) Hsl
Creates a new Hsl color instance by copying the current instance and optionally updating its properties.
darker([num k = 1]) Hsl
Returns a darker copy of this color.
override
displayable() bool
Returns true if and only if the color is displayable on standard hardware.
override
formatHex() String
Returns a hexadecimal string representing this color in RGB space, such as #f7eaba.
inherited
formatHex8() String
Returns a hexadecimal string representing this color in RGBA space, such as #f7eaba90.
inherited
formatHsl() String
Returns a string representing this color according to the CSS Color Module Level 3 specification, such as hsl(257, 50%, 80%) or hsla(257, 50%, 80%, 0.2).
override
formatRgb() String
Returns a string representing this color according to the CSS Object Model specification, such as rgb(247, 234, 186) or rgba(247, 234, 186, 0.2).
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
rgb() Rgb
Returns the RGB equivalent of this color.
override
toString() String
An alias for formatRgb.
inherited

Operators

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