about summary refs log tree commit diff stats
path: root/src/types
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2022-01-22 23:33:36 +0100
committerbptato <nincsnevem662@gmail.com>2022-01-22 23:33:36 +0100
commit6ff61c5ad2ad2af36195b83582ed98be57b93f18 (patch)
tree899799dfea6cc07433aaf77985f2aefc9964b74a /src/types
parentc73367b5e940c184247908a22cd4a495de4a0fde (diff)
downloadchawan-6ff61c5ad2ad2af36195b83582ed98be57b93f18.tar.gz
Avoid unnecessary rendering on hover change etc
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 2690d35d..588e59d3 100644
--- a/src/types/color.nim
+++ b/src/types/color.nim
@@ -34,6 +34,9 @@ func a*(c: RGBAColor): int =
 func rgb*(r, g, b: int): RGBColor =
   return RGBColor((r shl 16) or (g shl 8) or b)
 
+func `==`*(a, b: RGBAColor): bool =
+  return int(a) == int(b)
+
 
 func r*(c: RGBColor): int =
   return int(c) shr 16 and 0xff