Documentation
¶
Index ¶
- Constants
- Variables
- func GetName(col RepaColor) (string, bool)
- type RepaColor
- func (col RepaColor) A11YPair() RepaColor
- func (col RepaColor) AlphaBlendRgb(c2 RepaColor, gamma float64) RepaColor
- func (col RepaColor) AnsiBg() string
- func (col RepaColor) AnsiFg() string
- func (col RepaColor) Blend(c2 RepaColor, fraction float64, mode int, useAlpha bool) RepaColor
- func (col RepaColor) ContrastRatio(c2 RepaColor) float64
- func (col RepaColor) Hex() string
- func (col RepaColor) HslString() string
- func (col RepaColor) LabString() string
- func (col RepaColor) LchString() string
- func (col RepaColor) Luminance() float64
- func (col RepaColor) OkLabString() string
- func (col RepaColor) OkLchString() string
- func (col RepaColor) RGB256() (r, g, b uint8)
- func (col RepaColor) RGBA() (r, g, b, a uint32)
- func (col RepaColor) RGBA256() (r, g, b, a uint8)
- func (col RepaColor) RgbString() string
- func (col RepaColor) String() string
- func (col RepaColor) XyzString() string
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 ¶
Types ¶
type RepaColor ¶
type RepaColor struct { colorful.Color A float64 }
func CreateColor ¶
func (RepaColor) AlphaBlendRgb ¶
Blend two colors based on their alpha value `gamma` is the gamma correction value, default is 2.2
func (RepaColor) ContrastRatio ¶
func (RepaColor) OkLabString ¶
func (RepaColor) OkLchString ¶
Click to show internal directories.
Click to hide internal directories.