diff options
author | bptato <nincsnevem662@gmail.com> | 2022-01-22 23:33:36 +0100 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2022-01-22 23:33:36 +0100 |
commit | 6ff61c5ad2ad2af36195b83582ed98be57b93f18 (patch) | |
tree | 899799dfea6cc07433aaf77985f2aefc9964b74a /src/types | |
parent | c73367b5e940c184247908a22cd4a495de4a0fde (diff) | |
download | chawan-6ff61c5ad2ad2af36195b83582ed98be57b93f18.tar.gz |
Avoid unnecessary rendering on hover change etc
Diffstat (limited to 'src/types')
-rw-r--r-- | src/types/color.nim | 3 |
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 |