From cd1a36414028cbd3028a5f87ca9b91a314f5464c Mon Sep 17 00:00:00 2001 From: bptato Date: Tue, 27 Jun 2023 09:24:10 +0200 Subject: term: convert 8-bit colors to ANSI (Instead of crashing) --- src/types/color.nim | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/types') 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)) -- cgit