Documentation
¶
Index ¶
- func ClampRGB(r, g, b float64) (_, _, _ float64)
- func ColorToNLRGBA(c color.Color) (_, _, _, _ float64)
- func ColorToNOkLabA(c color.Color) (lightness, chromaA, chromaB, a float64)
- func Delinearize(l float64) uint32
- func DelinearizeF(l float64) float64
- func Enum(color, alpha, slow bool) iter.Seq[_color.RGBA64]
- func EnumColor[C _color.Color](color, alpha, slow bool, m _color.Model) iter.Seq[C]
- func EqFloat64Fuzzy(a, b float64) bool
- func EqFloat64SliceFuzzy(a, b []float64) bool
- func LMStoLRGB(l, m, s float64) (_, _, _ float64)
- func LMStoOkLab(l, m, s float64) (_, _, _ float64)
- func LMStoXYZ(l, m, s float64) (_, _, _ float64)
- func LRGBtoLMS(r, g, b float64) (_, _, _ float64)
- func LRGBtoRGB(r, g, b float64) (_, _, _ uint32)
- func LRGBtoXYZ(r, g, b float64) (_, _, _ float64)
- func Linearize(c uint32) float64
- func LinearizeF(l float64) float64
- func Model[C _color.Color](fromColor func(_color.Color) C) _color.Model
- func NLRGBAtoNRGBA(r, g, b, a float64) (_, _, _, _ uint32)
- func NLRGBAtoRGBA(r, g, b, a float64) (_, _, _, _ uint32)
- func NRGBAtoNLRGBA(r, g, b, a uint32) (_, _, _, _ float64)
- func OkLabToLMS(l, a, b float64) (_, _, _ float64)
- func RGBAtoNLRGBA(r, g, b, a uint32) (_, _, _, _ float64)
- func RGBtoLRGB(r, g, b uint32) (_, _, _ float64)
- func TestDistance[T tester[T], C color.Color](t T, color, alpha bool, midpoint func(c0, c1 C) C, f func(c0, c1 C) float64, ...)
- func TestModel[T tester[T], C Color](t T, color, alpha bool, m _color.Model, eq func(c0, c1 C) bool, ...)
- func XYZtoLMS(x, y, z float64) (_, _, _ float64)
- func XYZtoLRGB(x, y, z float64) (_, _, _ float64)
- type Color
- type ConvertTest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Delinearize ¶
Delinearize converts a linearRGB component in the range [0, 1] to an sRGB component in the range [0, 0xffff].
func DelinearizeF ¶ added in v0.2.0
Delinearize converts a linearRGB component in the range [0, 1] to an sRGB component in the range [0, 1].
func Enum ¶
Enum iterates over a sparse sample of the RGBA colour space.
If color is true, the colours will have distinct RGB components. otherwise, the colours will have identical RGB components.
If alpha is true, the colours will include transparency, otherwise the returned colours will be fully opaque.
If slow is false, an even smaller number of samples will be returned making this suitable for use in a nested loop.
color=true alpha=true slow=true: 87481 samples. color=true alpha=false slow=true: 140608 samples. color=true alpha=true slow=false: 649 samples. color=true alpha=false slow=false: 216 samples.
func EnumColor ¶
EnumColor is identical to Enum, but invokes a color.Model to return a concrete colour type.
func EqFloat64Fuzzy ¶
EqFloat64Fuzzy returns true if two floats aren't meaningfully distinct from each other.
NaNs aren't considered distinct (meaning this function will return true if both inputs are NaN).
func EqFloat64SliceFuzzy ¶
EqFloat64SliceFuzzy returns true if two lists of floats aren't meaningfully distinct from each other.
Returns false if the lists are of different lengths, EqFloat64Fuzzy returns false for any pair of floats.
func Linearize ¶
Linearize converts an sRGB component in the range [0, 0xffff] to a linearRGB component in the range [0, 1].
func LinearizeF ¶ added in v0.2.0
LinearizeF converts an sRGB component in the range [0, 1] to a linearRGB component in the range [0, 1].