package color

Import Path
	oss.terrastruct.com/d2/lib/color (on go.dev)

Dependency Relation
	imports 11 packages, and imported by 7 packages

Involved Source Files color.go gradient.go
Package-Level Type Names (total 3)
/* sort by: | */
Color string Position string
ColorStops []ColorStop Direction string ID string Type string func ParseGradient(cssGradient string) (Gradient, error) func GradientToSVG(gradient Gradient) string func LinearGradientToSVG(gradient Gradient) string func RadialGradientToSVG(gradient Gradient) string
Blue uint8 Green uint8 Red uint8 https://github.com/go-playground/colors/blob/main/rgb.go#L89 func Hex2RGB(hex string) (RGB, error) func Name2RGB(name string) RGB
Package-Level Functions (total 13)
func Darken(colorString string) (string, error)
func GradientToSVG(gradient Gradient) string
func IsGradient(color string) bool
func IsThemeColor(colorString string) bool
func Luminance(colorString string) (float64, error)
func LuminanceCategory(colorString string) (string, error)
func Name2RGB(name string) RGB
func ParseGradient(cssGradient string) (Gradient, error)
func UniqueGradientID(cssGradient string) string
func ValidColor(color string) bool
Package-Level Variables (total 3)
Package-Level Constants (total 20)
Alternative colors A
const AA4 = "AA4"
const AA5 = "AA5"
Alternative colors B
const AB5 = "AB5"
Base Colors: used for containers
const B2 = "B2"
const B3 = "B3"
const B4 = "B4"
const B5 = "B5"
const B6 = "B6"
Special
const N1 = "N1" // foreground color
const N2 = "N2"
const N3 = "N3"
const N4 = "N4"
const N5 = "N5"
const N6 = "N6"
const N7 = "N7" // background color
const None = "none"