dank16

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2025 License: MIT Imports: 4 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 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 GeneratePalette

func GeneratePalette(baseColor 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
	HonorPrimary string
	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"`
}

func GenerateVSCodeTheme

func GenerateVSCodeTheme(colors []string, isLight bool) VSCodeTheme

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