RayWithLuminance<T extends Ray> class final

Color with cached luminance for performance.

Inheritance
Available extensions

Constructors

RayWithLuminance(T _ray, double _precomputedLuminance)
Creates RayWithLuminance with cached luminance
const

Properties

alpha int

Available on RayWithLuminance<RayRgb8>, provided by the RayWithLuminanceRgb8Extensions extension

no setter
blue int

Available on RayWithLuminance<RayRgb8>, provided by the RayWithLuminanceRgb8Extensions extension

no setter
c double

Available on RayWithLuminance<RayOklch>, provided by the RayWithLuminanceOklchExtensions extension

no setter
colorSpace ColorSpace
The color space used by this Ray implementation.
no setteroverride
green int

Available on RayWithLuminance<RayRgb8>, provided by the RayWithLuminanceRgb8Extensions extension

no setter
h double

Available on RayWithLuminance<RayOklch>, provided by the RayWithLuminanceOklchExtensions extension

no setter
hashCode int
The hash code for this object.
no setteroverride
inverse Ray
Returns the color with inverted color values, preserving opacity.
no setteroverride
isDark bool
Whether this color is considered dark
no setter
isLight bool
Whether this color is considered light.
no setter
l double

Available on RayWithLuminance<RayOklch>, provided by the RayWithLuminanceOklchExtensions extension

Oklch component getters
no setter
luminance double
Returns cached luminance
no setteroverride
onRay RayWithLuminance<Ray>
Returns contrast color for text on this color.
no setter
opacity double
The opacity of this color (0.0 = transparent, 1.0 = opaque).
no setteroverride
red int

Available on RayWithLuminance<RayRgb8>, provided by the RayWithLuminanceRgb8Extensions extension

RGB component getters
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

lerp(Ray other, double t) Ray
Linearly interpolates between this color and other.
override
maxContrast(Ray a, Ray b) Ray
Returns the color (a or b) with the highest contrast to this color.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toArgbInt() int

Available on RayWithLuminance<RayRgb8>, provided by the RayWithLuminanceRgb8Extensions extension

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.
toHex([int length = 6, HexFormat format = HexFormat.rgba]) String
Returns hex string.
toHsl() RayHsl
Converts this color to HSL representation.
override
toJson() → 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.
override
toRgbaInt() int

Available on RayWithLuminance<RayRgb8>, provided by the RayWithLuminanceRgb8Extensions extension

toRgbaStr() String

Available on RayWithLuminance<RayRgb8>, provided by the RayWithLuminanceRgb8Extensions extension

toRgbInt() int

Available on RayWithLuminance<RayRgb8>, provided by the RayWithLuminanceRgb8Extensions extension

toRgbStr() String

Available on RayWithLuminance<RayRgb8>, provided by the RayWithLuminanceRgb8Extensions extension

RGB-specific output methods
toString() String
A string representation of this object.
override
withChroma(double chroma) RayWithLuminance<RayOklch>

Available on RayWithLuminance<RayOklch>, provided by the RayWithLuminanceOklchExtensions extension

withHue(double hue) RayWithLuminance<RayOklch>

Available on RayWithLuminance<RayOklch>, provided by the RayWithLuminanceOklchExtensions extension

withLightness(double lightness) RayWithLuminance<RayOklch>

Available on RayWithLuminance<RayOklch>, provided by the RayWithLuminanceOklchExtensions extension

Oklch-specific manipulation methods
withOpacity(double opacity) RayWithLuminance<T>
Creates a new color with different opacity (0.0-1.0).
override

Operators

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

Static Methods

fromRay<T extends Ray>(T ray) RayWithLuminance<T>
Factory with automatic type inference