color

package
v0.0.0-...-37928d8 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CS_RGB   = iota
	CS_HSL   = iota
	CS_LAB   = iota
	CS_LCH   = iota
	CS_HCL   = iota
	CS_OKLAB = iota
	CS_OKLCH = iota
	CS_XYZ   = iota
)
View Source
const (
	BLEND_RGB       = iota
	BLEND_LINEARRGB = iota
	BLEND_HSV       = iota
	BLEND_LAB       = iota
	BLEND_LCH       = iota
	BLEND_OKLAB     = iota
	BLEND_OKLCH     = iota
	BLEND_XYZ       = iota
)
View Source
const Delta = colorful.Delta

Variables

View Source
var ANSI_RESET = "\033[0m"
View Source
var BLACK = RepaColor{colorful.Color{R: 0, G: 0, B: 0}, 1}
View Source
var DARKGRAY = RepaColor{colorful.Color{R: .25, G: .25, B: .25}, 1}
View Source
var GRAY = RepaColor{colorful.Color{R: .5, G: .5, B: .5}, 1}
View Source
var LIGHTGRAY = RepaColor{colorful.Color{R: .75, G: .75, B: .75}, 1}
View Source
var NOCOLOR = RepaColor{}
View Source
var WHITE = RepaColor{colorful.Color{R: 1, G: 1, B: 1}, 1}

Functions

func GetName

func GetName(col RepaColor) (string, bool)

Types

type RepaColor

type RepaColor struct {
	colorful.Color
	A float64
}

func CreateColor

func CreateColor(mode int, v1, v2, v3, a float64) RepaColor

func MakeColor

func MakeColor(col color.Color) RepaColor

func ParseColor

func ParseColor(cstr string, usefallback bool) (col RepaColor, err error)

func (RepaColor) A11YPair

func (col RepaColor) A11YPair() RepaColor

func (RepaColor) AlphaBlendRgb

func (col RepaColor) AlphaBlendRgb(c2 RepaColor, gamma float64) RepaColor

Blend two colors based on their alpha value `gamma` is the gamma correction value, default is 2.2

func (RepaColor) AnsiBg

func (col RepaColor) AnsiBg() string

func (RepaColor) AnsiFg

func (col RepaColor) AnsiFg() string

func (RepaColor) Blend

func (col RepaColor) Blend(c2 RepaColor, fraction float64, mode int, useAlpha bool) RepaColor

func (RepaColor) ContrastRatio

func (col RepaColor) ContrastRatio(c2 RepaColor) float64

func (RepaColor) Hex

func (col RepaColor) Hex() string

func (RepaColor) HslString

func (col RepaColor) HslString() string

func (RepaColor) LabString

func (col RepaColor) LabString() string

func (RepaColor) LchString

func (col RepaColor) LchString() string

func (RepaColor) Luminance

func (col RepaColor) Luminance() float64

func (RepaColor) OkLabString

func (col RepaColor) OkLabString() string

func (RepaColor) OkLchString

func (col RepaColor) OkLchString() string

func (RepaColor) RGB256

func (col RepaColor) RGB256() (r, g, b uint8)

func (RepaColor) RGBA

func (col RepaColor) RGBA() (r, g, b, a uint32)

func (RepaColor) RGBA256

func (col RepaColor) RGBA256() (r, g, b, a uint8)

func (RepaColor) RgbString

func (col RepaColor) RgbString() string

func (RepaColor) String

func (col RepaColor) String() string

func (RepaColor) XyzString

func (col RepaColor) XyzString() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳