From e4400c5f1e84c18d2126f2cb502ae10685977cbb Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Sat, 20 Jun 2026 03:20:01 -0400 Subject: refactor: combined all station crafting --- internal/color/color.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'internal/color') diff --git a/internal/color/color.go b/internal/color/color.go index 9496a1d..58c040c 100644 --- a/internal/color/color.go +++ b/internal/color/color.go @@ -87,7 +87,7 @@ func nearestANSIBg(index int) int { return fg - 30 + 40 } -func nearestCubeComponent(v int) int { +func nearestCube(v int) int { if v < 48 { return 0 } @@ -107,9 +107,9 @@ func nearestCubeComponent(v int) int { } func NearestXterm256(r, g, b int) int { - ri := nearestCubeComponent(r) - gi := nearestCubeComponent(g) - bi := nearestCubeComponent(b) + ri := nearestCube(r) + gi := nearestCube(g) + bi := nearestCube(b) cubeIdx := 16 + ri*36 + gi*6 + bi cubeDist := colorDist(r, g, b, cubeValues[ri], cubeValues[gi], cubeValues[bi]) @@ -325,10 +325,10 @@ func renderGradient(mode string, spec ColorSpec, text string) string { } func ExpandTags(mode string, text string) string { - return ExpandTagsWithDefault(mode, NoColor(), text) + return ExpandTagsDefault(mode, NoColor(), text) } -func ExpandTagsWithDefault(mode string, def ColorSpec, text string) string { +func ExpandTagsDefault(mode string, def ColorSpec, text string) string { if !strings.Contains(text, "{") { if !def.Empty() { return Render(mode, def, text) -- cgit v1.2.3