Hsla class
Hsl class support to interact with a color as a hsl with hue, saturation, and lightness with optional alpha blending. The hue is a ratio of 360 degrees 360° = 1 or 0, (1° == (1/360)), saturation and lightness is a 0..1 fraction (1 == 100%) and alpha is a 0..1 fraction.
- Implemented types
Constructors
- Hsla(num hue, num saturation, num lightness, [num? alpha])
-
hue
is a 0..1 fraction of 360 degrees (360 == 0).saturation
is a 0..1 fraction (100% == 1).lightness
is a 0..1 fraction (100% == 1).alpha
is a 0..1 fraction, alpha blending between 0..1, 1 == 100% opaque. - Hsla.fromArgbValue(num value)
-
factory
- Hsla.fromColor(Color color)
-
factory
- Hsla.fromRgba(Rgba rgba)
-
factory
- Hsla.fromString(String hexValue)
-
factory
Properties
- alpha → num?
-
Returns number as 0..1
no setter
- argbValue → int
-
Return argb as a value (int).
no setteroverride
- color → Color
-
no setter
- cssExpression → String
-
Returns the expression part of a CSS declaration. Declaration is:
no setter
- hashCode → int
-
The hash code for this object.
no setteroverride
- hue → num
-
Returns 0..1 fraction (ratio of 360°, e.g. 1° == 1/360).
no setter
- hueDegrees → num
-
Returns number as degrees 0..360.
no setter
- lightness → num
-
Returns 0..1 fraction (1 == 100%).
no setter
- lightnessPercentage → num
-
Returns number as percentage 0..100.
no setter
- rgba → Rgba
-
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- saturation → num
-
Returns 0..1 fraction (1 == 100%)
no setter
- saturationPercentage → num
-
Returns number as percentage 0..100
no setter
Methods
-
darker(
num amount) → Hsla -
lighter(
num amount) → Hsla -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toHexArgbString(
) → String -
Canonical form for color #rrggbb with alpha blending (0.0 == full
transparency and 1.0 == fully opaque). If _argb length is 6 it's an
rrggbb otherwise it's aarrggbb.
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override