colours

package
v0.0.0-...-b8e17cf Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 26, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Xn float64 = 95.0489
	Yn float64 = 100
	Zn float64 = 109.8840
)

Standard Illuminati D65 used for XYZ conversion

Variables

This section is empty.

Functions

func Clamp

func Clamp(n, a, b float64) float64

General functions

func ClampFloatToUint8

func ClampFloatToUint8(n float64) uint8

func Cos

func Cos(x float64) float64

Takes degrees as input

func HueAtan2

func HueAtan2(x, y float64) float64

Returns value is in degrees

func Sin

func Sin(x float64) float64

Takes degrees as input

func Sqr

func Sqr(a float64) float64

Types

type LAB

type LAB struct {
	L, A, B float64
}

LAB Colour

func (*LAB) RGB

func (lab *LAB) RGB() *RGB

Converts a LAB colour to RGB

func (*LAB) XYZ

func (lab *LAB) XYZ() *XYZ

Converts a LAB colour to XYZ

type RGB

type RGB struct {
	R, G, B float64
}

RGB Data, range 0-255

func (*RGB) LAB

func (rgb *RGB) LAB() *LAB

Converts an RGB colour to the LAB colour space

func (*RGB) XYZ

func (rgb *RGB) XYZ() *XYZ

Converts an RGB colour to the XYZ colour space

type XYZ

type XYZ struct {
	X, Y, Z float64
}

XYZ

func (*XYZ) LAB

func (xyz *XYZ) LAB() *LAB

Converts an XYZ colour to the LAB colour space

func (*XYZ) RGB

func (xyz *XYZ) RGB() *RGB

Converts an XYZ colour to the RGB colour space

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL