about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2022-05-21 22:42:03 +0200
committerbptato <nincsnevem662@gmail.com>2022-05-21 22:42:03 +0200
commit7177a737f5feee60a9775560f2a953bae26bd96a (patch)
treeb1f5eb8af27faa959160fb70fc5f514e51f4526e
parent3aea225b34766ce574ad4c8ed7570861f960e34d (diff)
downloadchawan-7177a737f5feee60a9775560f2a953bae26bd96a.tar.gz
Fix compilation on 32-bit architectures
-rw-r--r--src/types/color.nim9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/types/color.nim b/src/types/color.nim
index 3f8307de..cb3b2f3f 100644
--- a/src/types/color.nim
+++ b/src/types/color.nim
@@ -1,8 +1,7 @@
-# TODO both should probably be distinct int32
 type
-  RGBColor* = distinct int
+  RGBColor* = distinct uint32
 
-  RGBAColor* = distinct int
+  RGBAColor* = distinct uint32
 
   CellColor* = object
     case rgb*: bool
@@ -52,7 +51,7 @@ func rgba*(r, g, b, a: int): RGBAColor =
   return RGBAColor((a shl 24) or (r shl 16) or (g shl 8) or b)
 
 converter toRGBColor*(i: RGBAColor): RGBColor =
-  return RGBColor(int(i) and 0xFFFFFF)
+  return RGBColor(uint32(i) and 0xFFFFFFu32)
 
 converter toRGBAColor*(i: RGBColor): RGBAColor =
-  return RGBAColor(int(i) or 0xFF000000)
+  return RGBAColor(uint32(i) or 0xFF000000u32)