aboutsummaryrefslogtreecommitdiffstats
path: root/src/types
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2023-06-27 09:24:10 +0200
committerbptato <nincsnevem662@gmail.com>2023-06-27 09:24:10 +0200
commitcd1a36414028cbd3028a5f87ca9b91a314f5464c (patch)
tree06e13f10cff027223fb2d1bb0c382c046bdcdb11 /src/types
parent4ba9ea50918bc2fac6a556765a0154e37bf4e65e (diff)
downloadchawan-cd1a36414028cbd3028a5f87ca9b91a314f5464c.tar.gz
term: convert 8-bit colors to ANSI
(Instead of crashing)
Diffstat (limited to 'src/types')
-rw-r--r--src/types/color.nim3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/types/color.nim b/src/types/color.nim
index 09847147..a22ce1e5 100644
--- a/src/types/color.nim
+++ b/src/types/color.nim
@@ -36,6 +36,9 @@ func rgbcolor*(color: CellColor): RGBColor =
func color*(color: CellColor): uint8 =
cast[uint8](color.n)
+func eightbit*(color: CellColor): EightBitColor =
+ EightBitColor(color.color)
+
func cellColor*(rgb: RGBColor): CellColor =
return CellColor(rgb: true, n: uint32(rgb))