module HSLuv
Overview
HSLuv is a perceptually uniform colorspace.
Extended Modules
Defined in:
hsluv.crConstant Summary
-
EPSILON =
0.0088564516
-
KAPPA =
903.2962962
-
M =
Matrix[FloatVec[3.240969941904521, -1.537383177570093, -0.498610760293], FloatVec[-0.96924363628087, 1.87596750150772, 0.041555057407175], FloatVec[0.055630079696993, -0.20397695888897, 1.056971514242878]]
-
M_INV =
Matrix[FloatVec[0.41239079926595, 0.35758433938387, 0.18048078840183], FloatVec[0.21263900587151, 0.71516867876775, 0.072192315360733], FloatVec[0.019330818715591, 0.11919477979462, 0.95053215224966]]
-
REF_U =
0.19783000664283
-
REF_V =
0.46831999493879
-
REF_Y =
1.0
-
VERSION =
"0.1.0"
Instance Method Summary
- #distance_from_pole(point) : Float64
- #dot_product(a, b) : Float64
- #f(t) : Float64
- #f_inv(t) : Float64
- #from_linear(c) : Float64
- #get_bounds(l) : Array(Array(Float64))
-
#hex_to_hpluv(hex : String) : FloatVec
Converts a hexadecimal string to an HPLuv hsl array.
-
#hex_to_hsluv(hex : String) : FloatVec
Converts a hexadecimal string to HSLuv, in h, s, l order
-
#hex_to_rgb(hex : String) : FloatVec
Converts a hex color string to an rgb array
-
#hpluv_to_hex(h : Float64, s : Float64, l : Float64) : String
Converts an HPLuv color to a hexadecimal string.
- #hpluv_to_lch(arr) : FloatVec
-
#hpluv_to_rgb(h : Float64, s : Float64, l : Float64) : FloatVec
Converts an HPLuv hsl color to an rgb array.
-
#hsluv_to_hex(h : Float64, s : Float64, l : Float64) : String
Converts an HSLuv color to a hexadecimal string.
- #hsluv_to_lch(arr) : FloatVec
-
#hsluv_to_rgb(h : Float64, s : Float64, l : Float64) : FloatVec
Converts an HSLuv color to an rgb array.
- #intersect_line_line(line1, line2) : Float64
- #lch_to_hpluv(arr) : FloatVec
- #lch_to_hsluv(arr) : FloatVec
- #lch_to_luv(arr) : FloatVec
-
#lch_to_rgb(l : Float64, c : Float64, h : Float64) : FloatVec
Converts an LCh color to an rgb array.
- #length_of_ray_until_intersect(theta, line)
- #luv_to_lch(arr) : FloatVec
- #luv_to_xyz(arr) : FloatVec
- #max_chroma_for(l, h) : Float64
- #max_safe_chroma_for(l) : Float64
-
#rgb_prepare(arr) : StaticArray(Int32, 3)
Scales, clamps, and rounds an rgb color array from [0, 1] to [0, 255]
-
#rgb_to_hex(r : Float64, g : Float64, b : Float64) : String
Converts an rgb color to a hex color code - e.g.
-
#rgb_to_hpluv(r : Float64, g : Float64, b : Float64) : FloatVec
Converts an rgb color to an HPLuv hsl array.
-
#rgb_to_hsluv(r : Float64, g : Float64, b : Float64) : FloatVec
Converts an rgb color to an HSLuv hsl array.
-
#rgb_to_lch(r : Float64, g : Float64, b : Float64) : FloatVec
Converts an rgb color to an LCh array.
-
#rgb_to_xyz(arr : FloatVec) : FloatVec
Converts an rgb array to an xyz color array.
- #to_linear(c) : Float64
- #xyz_to_luv(arr) : FloatVec
- #xyz_to_rgb(arr) : FloatVec
Instance Method Detail
Converts a hexadecimal string to an HPLuv hsl array.
Converts a hexadecimal string to HSLuv, in h, s, l order
Converts an HPLuv color to a hexadecimal string.
Converts an HPLuv hsl color to an rgb array.
Converts an HSLuv color to a hexadecimal string.
Converts an HSLuv color to an rgb array.
Converts an LCh color to an rgb array.
Scales, clamps, and rounds an rgb color array from [0, 1] to [0, 255]
Converts an rgb color to a hex color code - e.g. rgb_to_hex(0xff, 0xaa, 0x88) == "#ffaa88"
Converts an rgb color to an HPLuv hsl array.
Converts an rgb color to an HSLuv hsl array.
Converts an rgb color to an LCh array.
Converts an rgb array to an xyz color array.