dank16

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContrastRatio

func ContrastRatio(hexFg, hexBg string) float64

func DeltaPhiStar

func DeltaPhiStar(hexFg, hexBg string, negativePolarity bool) float64

func DeltaPhiStarContrast

func DeltaPhiStarContrast(hexFg, hexBg string, isLightMode bool) float64

func DeriveContainer added in v0.4.0

func DeriveContainer(primary string, isLight bool) string

func EnrichVSCodeTheme

func EnrichVSCodeTheme(themeData []byte, colors []string) ([]byte, error)

func EnsureContrast

func EnsureContrast(hexColor, hexBg string, minRatio float64, isLightMode bool) string

func EnsureContrastDPS

func EnsureContrastDPS(hexColor, hexBg string, minLc float64, isLightMode bool) string

func EnsureContrastDPSLstar

func EnsureContrastDPSLstar(hexColor, hexBg string, minLc float64, isLightMode bool) string

Nudge L* until contrast is good enough. Keeps hue intact unlike HSV fiddling.

func GenerateAlacrittyTheme

func GenerateAlacrittyTheme(colors []string) string

func GenerateFootTheme added in v0.4.0

func GenerateFootTheme(colors []string) string

func GenerateGhosttyTheme added in v0.4.0

func GenerateGhosttyTheme(colors []string) string

func GenerateJSON added in v0.4.0

func GenerateJSON(colors []string) string

func GenerateKittyTheme added in v0.4.0

func GenerateKittyTheme(colors []string) string

func GeneratePalette

func GeneratePalette(primaryColor string, opts PaletteOptions) []string

func Luminance

func Luminance(hex string) float64

func RGBToHex

func RGBToHex(rgb RGB) string

Types

type HSV

type HSV struct {
	H, S, V float64
}

func RGBToHSV

func RGBToHSV(rgb RGB) HSV

type PaletteOptions

type PaletteOptions struct {
	IsLight    bool
	Background string
	UseDPS     bool
}

type RGB

type RGB struct {
	R, G, B float64
}

func HSVToRGB

func HSVToRGB(hsv HSV) RGB

func HexToRGB

func HexToRGB(hex string) RGB

type VSCodeTheme

type VSCodeTheme struct {
	Schema               string                        `json:"$schema"`
	Name                 string                        `json:"name"`
	Type                 string                        `json:"type"`
	Colors               map[string]string             `json:"colors"`
	TokenColors          []VSCodeTokenColor            `json:"tokenColors"`
	SemanticHighlighting bool                          `json:"semanticHighlighting"`
	SemanticTokenColors  map[string]VSCodeTokenSetting `json:"semanticTokenColors"`
}

type VSCodeTokenColor

type VSCodeTokenColor struct {
	Scope    interface{}        `json:"scope"`
	Settings VSCodeTokenSetting `json:"settings"`
}

type VSCodeTokenSetting

type VSCodeTokenSetting struct {
	Foreground string `json:"foreground,omitempty"`
	FontStyle  string `json:"fontStyle,omitempty"`
}

Jump to

Keyboard shortcuts

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