Documentation
¶
Index ¶
- Constants
- type Color
- func (c Color) ColorMode() string
- func (c Color) Contrast(percent int) Color
- func (c Color) Darken(percent int) Color
- func (c Color) Hex() string
- func (c Color) IsDark() bool
- func (c Color) IsEmpty() bool
- func (c Color) IsLight() bool
- func (c Color) Lighten(percent int) Color
- func (c Color) Mean() int
- func (c Color) Mix(other any, percent int) Color
- func (color Color) NotEmpty() bool
- func (c Color) RGBA() string
- func (c Color) String() string
- func (c Color) Text() Color
- func (c Color) TextExt() Color
Constants ¶
View Source
const ColorModeAuto = "auto"
View Source
const ColorModeDark = "dark"
View Source
const ColorModeExtDark = "dark"
View Source
const ColorModeExtLight = "light"
View Source
const ColorModeExtMediumDark = "medium-dark"
View Source
const ColorModeExtMediumLight = "medium-light"
View Source
const ColorModeLight = "light"
View Source
const HexBlack = "#000000"
View Source
const HexWhite = "#FFFFFF"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Color ¶
func (Color) ColorMode ¶
ColorMode returns "light" if this is a light color, or "dark" if this is a dark color.
func (Color) Contrast ¶
Contrast mixes this color with either black or white. Light colors become darker, and dark colors become lighter. The percentage determines how much to mix the colors.
func (Color) Darken ¶
Darken mixes this color with black, moving towards black by the specified percentage.
func (Color) Lighten ¶
Lighten mixes this color with white, moving towards white by the specified percentage.
func (Color) Mix ¶
Mix combines this color with another one, moving towards the 'other' color by a specified percentage. 0% will return this color, 100% will return the 'other' color.
Click to show internal directories.
Click to hide internal directories.