OKLabGradient creates a gradient from (t,L,a,b) values with t∈[0,1] the position, L∈[0,1] the lightness, a∈[-1,1], and b∈[-1,1].
(points [][4]float64)
| 159 | |
| 160 | // OKLabGradient creates a gradient from (t,L,a,b) values with t∈[0,1] the position, L∈[0,1] the lightness, a∈[-1,1], and b∈[-1,1]. |
| 161 | func OKLabGradient(points [][4]float64) ColorFunc { |
| 162 | genSRGBLUTs() |
| 163 | if len(points) == 0 { |
| 164 | return func(y float64) color.RGBA { return color.RGBA{} } |
| 165 | } |
| 166 | return func(y float64) color.RGBA { |
| 167 | p := interpolateGradient(y, points) |
| 168 | return oklab2rgb(p[1], p[2], p[3]) |
| 169 | } |
| 170 | } |
no test coverage detected