color

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2022 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DarkMode ...
	DarkMode contrastPolarity = iota
	// LightMode ...
	LightMode

	// LessContrast ...
	LessContrast = DarkMode
	// MoreContrast ...
	MoreContrast = LightMode
)

Variables

View Source
var (
	// White ...
	White = ByHex("#ffffff")
	// Black ...
	Black = ByHex("#000000")
)
View Source
var Mode contrastPolarity

Mode ...

Functions

This section is empty.

Types

type AdaptorColor

type AdaptorColor interface {
	fmt.Stringer
	fmt.GoStringer
	AdjustConstrast(polarity contrastPolarity, percent percent) AdaptorColor
	Analogous() analogous
	AsColorfulColor() colorful.Color
	AsGamutColor() gamut.Color
	AsGooKitColor() color.Color
	AsHexColor() string
	AsHexPair() FgBgTuple
	AsImageColor() imgcolor.Color
	AsPrettyJSONColor() [2]string
	AsRGBColor() color.RGBColor
	AsTermenvColor() termenv.Color
	Blend(other AdaptorColor, blendPercent percent) AdaptorColor
	Complementary() AdaptorColor
	Contrast() AdaptorColor
	Darker(percent percent) AdaptorColor
	HueOffset(degrees º) AdaptorColor
	Lighter(percent percent) AdaptorColor
	Monochromatic() shades
	Similar(count int) adaptorPalette
	SplitComplementary() splitComplementary
	Triadic() triadic
	IsPastel() bool
	IsHappy() bool
	IsCool() bool
	IsWarm() bool
	ToPleasingPalette(colorCount uint) adaptorPalette
}

AdaptorColor ...

func ByHex

func ByHex(hex string) AdaptorColor

ByHex ...

func ByName

func ByName(name string) (AdaptorColor, bool)

ByName ...

func MustByName

func MustByName(name string) AdaptorColor

MustByName ...

type Distance

type Distance struct{ R, G, B float64 }

Distance ...

type FgBgTuple

type FgBgTuple struct {
	Fg string `yaml:"fg"`
	Bg string `yaml:"bg"`
}

FgBgTuple ...

func (FgBgTuple) Format

func (s FgBgTuple) Format() func(value string) string

Format ...

func (FgBgTuple) Reverse

func (s FgBgTuple) Reverse() FgBgTuple

Reverse ...

Jump to

Keyboard shortcuts

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