diff options
author | quou <quou@disroot.org> | 2024-08-07 19:31:03 +1000 |
---|---|---|
committer | quou <quou@disroot.org> | 2024-08-10 19:01:10 +1000 |
commit | db26f27bbeea7de759c8f5a30fa79789bed066a2 (patch) | |
tree | 8ee310f577ac54af794f901d8aba41aed2aeea7b | |
parent | fd862f1be0b91b48135a9670362922796fae879e (diff) |
col_add
-rw-r--r-- | render.c | 9 | ||||
-rw-r--r-- | render.h | 1 |
2 files changed, 10 insertions, 0 deletions
@@ -165,6 +165,15 @@ Colour col_scl(Colour a, unsigned char s) { return r; } +Colour col_add(Colour a, Colour b) { + Colour r; + r.r = ((int)a.r + (int)b.r) & 0xff; + r.g = ((int)a.g + (int)b.g) & 0xff; + r.b = ((int)a.b + (int)b.b) & 0xff; + r.a = ((int)a.a + (int)b.a) & 0xff; + return r; +} + void ren_begin(Renderer* r, Colour* t, int* d, int w, int h) { r->t = t; r->vp[0] = w; @@ -42,6 +42,7 @@ Colour blend(Colour dst, Colour src); Colour blend_mod(Colour dst, Colour src, Colour mod); Colour col_mul(Colour a, Colour b); Colour col_scl(Colour a, unsigned char s); +Colour col_add(Colour a, Colour b); typedef struct { Colour* p; |