Hsluv class Null safety

Human-friendly HSL conversion utility class. The math for most of this module was taken from:

Constructors

Hsluv()

Properties

hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
A string representation of this object. [...]
inherited

Operators

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

Static Methods

dotProduct(List<double> a, List<double> b) double
fromLinear(double c) double
getBounds(double L) List<Line>
For a given lightness, return a list of 6 lines in slope-intercept form that represent the bounds in CIELUV, stepping over which will push a value out of the RGB gamut
hexToHpluv(String s) List<double>
HSLuv values are ranging in 0;360, 0;100 and 0;100 and RGB in 0;1. @param hex A #RRGGBB representation of a color. @return An array containing the color's HSL values in HPLuv (pastel variant) color space. */
hexToHsluv(String s) List<double>
HSLuv values are ranging in 0;360, 0;100 and 0;100 and RGB in 0;1. @param tuple An array containing the color's HSL values in HPLuv (pastel variant) color space. @return An array containing the color's HSL values in HSLuv color space. */
hexToRgb(String hex) List<double>
RGB values are ranging in 0;1. @param hex A #RRGGBB representation of a color. @return An array containing the color's RGB values.
hpluvToHex(List<double> tuple) String
hpluvToLch(List<double> tuple) List<double>
HSLuv values are in 0;360, 0;100 and 0;100. @param tuple An array containing the color's H,S,L values in HPLuv (pastel variant) color space. @return An array containing the resulting color's LCH coordinates.
hpluvToRgb(List<double> tuple) List<double>
HSLuv values are ranging in 0;360, 0;100 and 0;100 and RGB in 0;1. @param tuple An array containing the color's HSL values in HPLuv (pastel variant) color space. @return An array containing the resulting color's RGB coordinates.
hsluvToHex(List<double> tuple) String
HSLuv values are ranging in 0;360, 0;100 and 0;100 and RGB in 0;1. @param tuple An array containing the color's HSL values in HSLuv color space. @return A string containing a #RRGGBB representation of given color. */
hsluvToLch(List<double> tuple) List<double>
HSLuv values are ranging in 0;360, 0;100 and 0;100. @param tuple An array containing the color's H,S,L values in HSLuv color space. @return An array containing the resulting color's LCH coordinates.
hsluvToRgb(List<double> tuple) List<double>
HSLuv values are ranging in 0;360, 0;100 and 0;100 and RGB in 0;1. @param tuple An array containing the color's HSL values in HSLuv color space. @return An array containing the resulting color's RGB coordinates.
lchToHpluv(List<double> tuple) List<double>
HSLuv values are ranging in 0;360, 0;100 and 0;100. @param tuple An array containing the color's LCH values. @return An array containing the resulting color's HSL coordinates in HPLuv (pastel variant) color space.
lchToHsluv(List<double> tuple) List<double>
HSLuv values are ranging in 0;360, 0;100 and 0;100. @param tuple An array containing the color's LCH values. @return An array containing the resulting color's HSL coordinates in HSLuv color space.
lchToLuv(List<double> tuple) List<double>
@param tuple An array containing the color's L,C,H values. @return An array containing the resulting color's LUV coordinates.
lchToRgb(List<double> tuple) List<double>
RGB values are ranging in 0;1. @param tuple An array containing the color's LCH values. @return An array containing the resulting color's RGB coordinates.
lToY(double L) double
luvToLch(List<double> tuple) List<double>
@param tuple An array containing the color's L,U,V values. @return An array containing the resulting color's LCH coordinates.
luvToXyz(List<double> tuple) List<double>
XYZ coordinates are ranging in 0;1. @param tuple An array containing the color's L,U,V values. @return An array containing the resulting color's XYZ coordinates.
maxChromaForLH(double L, double H) double
maxSafeChromaForL(double L) double
For given lightness, returns the maximum chroma. Keeping the chroma value below this number will ensure that for any hue, the color is within the RGB gamut.
rgbToHex(List<double> tuple) String
RGB values are ranging in 0;1. @param tuple An array containing the color's RGB values. @return A string containing a #RRGGBB representation of given color.
rgbToHpluv(List<double> tuple) List<double>
HSLuv values are ranging in 0;360, 0;100 and 0;100 and RGB in 0;1. @param tuple An array containing the color's RGB coordinates. @return An array containing the resulting color's HSL coordinates in HPLuv (pastel variant) color space.
rgbToHsluv(List<double> tuple) List<double>
HSLuv values are ranging in 0;360, 0;100 and 0;100 and RGB in 0;1. @param tuple An array containing the color's RGB coordinates. @return An array containing the resulting color's HSL coordinates in HSLuv color space.
rgbToLch(List<double> tuple) List<double>
RGB values are ranging in 0;1. @param tuple An array containing the color's RGB values. @return An array containing the resulting color's LCH coordinates.
rgbToXyz(List<double> tuple) List<double>
RGB coordinates are ranging in 0;1 and XYZ coordinates in 0;1. @param tuple An array containing the color's R,G,B values. @return An array containing the resulting color's XYZ coordinates.
toLinear(double c) double
xyzToLuv(List<double> tuple) List<double>
XYZ coordinates are ranging in 0;1. @param tuple An array containing the color's X,Y,Z values. @return An array containing the resulting color's LUV coordinates.
xyzToRgb(List<double> tuple) List<double>
XYZ coordinates are ranging in 0;1 and RGB coordinates in 0;1 range. @param tuple An array containing the color's X,Y and Z values. @return An array containing the resulting color's red, green and blue.
yToL(double Y) double
http://en.wikipedia.org/wiki/CIELUV In these formulas, Yn refers to the reference white point. We are usin g illuminant D65, so Yn (see refY in Maxima file) equals 1. The formula is simplified accordingly.

Constants

epsilon → const double
0.0088564516
hexChars → const String
"0123456789abcdef"
kappa → const double
903.2962962
m → const List<List<double>>
[[3.240969941904521, -1.537383177570093, -0.498610760293], [-0.96924363628087, 1.87596750150772, 0.041555057407175], [0.055630079696993, -0.20397695888897, 1.056971514242878]]
minv → const List<List<double>>
[[0.41239079926595, 0.35758433938387, 0.18048078840183], [0.21263900587151, 0.71516867876775, 0.072192315360733], [0.019330818715591, 0.11919477979462, 0.95053215224966]]
refU → const double
0.19783000664283
refV → const double
0.46831999493879
refY → const double
1.0