RayOklab class base
Oklab color space implementation for perceptually uniform color manipulation.
Components: L (lightness 0-1), a (green-red axis), b (blue-yellow axis).
- Inheritance
- Available extensions
Constructors
- RayOklab.empty()
-
Creates a transparent black Oklab color.
const
- RayOklab.fromComponents(double _l, double _a, double _b, [double _opacity = 1.0])
-
Creates a RayOklab from individual LABO component values.
const
-
RayOklab.fromJson(Map<
String, dynamic> json) -
Creates an Oklab color from a JSON value.
factory
-
RayOklab.fromList(List<
num> values) -
Creates a RayOklab from a list of component values.
factory
Properties
- colorSpace → ColorSpace
-
The color space used by this Ray implementation.
no setteroverride
- hashCode → int
-
The hash code for this object.
no setteroverride
- inverse → RayOklab
-
Returns the color with inverted color values, preserving opacity.
no setteroverride
- lightness → double
-
The lightness component (0.0 to 1.0).
no setter
- luminance → double
-
Returns the relative luminance of the color (0.0 = darkest, 1.0 = lightest).
no setteroverride
- opacity → double
-
The opacity of this color (0.0 = transparent, 1.0 = opaque).
no setteroverride
- opponentA → double
-
The green-red opponent axis component.
no setter
- opponentB → double
-
The blue-yellow opponent axis component.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
lerp(
Ray other, double t) → RayOklab -
Linearly interpolates between this color and
other.override -
maxContrast(
Ray a, Ray b) → Ray -
Returns the color (
aorb) with the highest contrast to this color.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toColor(
) → Color -
Available on Ray, provided by the RayToFlutterColor extension
Converts this RayRgb8 to a Flutter Color. -
toColorSpace<
T extends Ray> () → T -
Converts this color to a different color space.
inherited
-
toColorWithOpacity(
double opacity) → Color -
Available on Ray, provided by the RayToFlutterColor extension
Converts this Ray to a Flutter Color with specific opacity. -
toHsl(
) → RayHsl -
Converts this color to HSL representation.
override
-
toJson(
) → Map< String, dynamic> -
Returns the color as a JSON-serializable value.
override
-
toList(
) → List< num> -
Returns the color components as a list.
override
-
toOklab(
) → RayOklab -
Converts this color to Oklab representation.
override
-
toOklch(
) → RayOklch -
Converts this color to Oklch representation.
override
-
toRgb16(
) → RayRgb16 -
Converts this color to 16-bit RGB representation.
override
-
toRgb8(
) → RayRgb8 -
Converts this color to 8-bit RGB representation.
inherited
-
toString(
) → String -
A string representation of this object.
override
-
withLightness(
double lightness) → RayOklab - Creates a new RayOklab with a different lightness value.
-
withOpacity(
double opacity) → RayOklab -
Creates a new color with different opacity (0.0-1.0).
override
-
withOpponentA(
double opponentA) → RayOklab - Creates a new RayOklab with a different green-red opponent axis value.
-
withOpponentB(
double opponentB) → RayOklab - Creates a new RayOklab with a different blue-yellow opponent axis value.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override
Static Methods
-
findMaxChromaPoint(
double a, double b) → List< double> - Finds the point of maximum chroma for a given hue direction in Oklab space.
-
getMaxValidChroma(
double lightness, double hue) → double - Gets the maximum valid chroma for a given lightness and hue combination.
-
parse(
String value) → RayOklab -
Parses a color string and returns a RayOklab.
override