diff options
| author | historia <[not public]> | 2026-06-20 03:20:01 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-06-20 03:20:01 -0400 |
| commit | e4400c5f1e84c18d2126f2cb502ae10685977cbb (patch) | |
| tree | 0523e9d68f1cfdc6f81b862e3068fe12c1a85054 /internal/color | |
| parent | 5ea082ab4e82409aebc889b496f43e52b003d4f7 (diff) | |
| download | thehouseoficarus-e4400c5f1e84c18d2126f2cb502ae10685977cbb.tar.gz | |
refactor: combined all station crafting
Diffstat (limited to 'internal/color')
| -rw-r--r-- | internal/color/color.go | 12 |
1 files changed, 6 insertions, 6 deletions
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) |
