color

package
v0.0.0-...-f3f5ea9 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BoundToGamutXY

func BoundToGamutXY(x, y, rx, ry, gx, gy, bx, by float64) (cx, cy float64)

BoundToGamutXY compares the point x,y to the triangle formed by rx,ry, gx,gy, bx,by. If the point falls within the triangle, x and y are returned. If the point falls outside the triangle, the x and y value of the nearest point on the triangle is returned.

func CtoRGB

func CtoRGB(c uint32) (r, g, b float64)

CtoRGB converts a 24 bit RGB value stored in the least significant bits of a uint32 to float64 values on the range of 0.0 to 1.0

func CtoTermBG

func CtoTermBG(c uint32, s string) string

CtoTermBG wraps s to set the terminal background color to the 24 bit RGB value of c

func CtoTermFG

func CtoTermFG(c uint32, s string) string

CtoTermFG wraps s to set the terminal foreground color to the 24 bit RGB value of c

func HSVtoRGB

func HSVtoRGB(h, s, v float64) (r, g, b float64)

HSVtoRGB converts hue, saturation and brightness values on the range of 0.0 to 1.0 to RGB floating point values on the range of 0.0 to 1.0

func RGBtoC

func RGBtoC(r, g, b float64) (c uint32)

RGBtoC converts r, g, and b float64 values on the range of 0.0 to 1.0 to a 24 bit RGB value stored in the least significant bits of a uint32. The inputs are clamped to the range of 0.0 to 1.0

func RGBtoHSV

func RGBtoHSV(r, g, b float64) (h, s, v float64)

RGBtoHSV converts red, green, and blue floating point values on the range 0.0 to 1.0 to hue, saturation and brightness values on the range 0.0 to 1.0

func RGBtoXYB

func RGBtoXYB(r, g, b float64) (x, y, bri float64)

RGBtoXYB converts red, green, and blue floating point values on the range 0.0 to 1.0 to CIE colorspace x, y, and brightness values on the range 0.0 to 1.0 using Phillips Wide RGB D65 conversion.

func XKCD

func XKCD(s string) (uint32, bool)

func XYBtoRGB

func XYBtoRGB(x, y, bri float64) (r, g, b float64)

XYBtoRGB converts CIE colorspace x, y, and brightness values on the range 0.0 to 1.0 to red, green, and blue floating point values on the range 0.0 to 1.0 using Phillips Wide RGB D65 conversion.

Types

This section is empty.

Jump to

Keyboard shortcuts

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