summaryrefslogtreecommitdiff
path: root/src/ui/color.h
blob: 43005a6cd7ec8b0c7037bb55fa9f08399bb7d0e5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#pragma once

#include <stdint.h>

typedef struct COLOR {
  uint8_t b, g, r, a;
} COLOR;

#define color_hex(value) \
  (uint8_t)((uint32_t)value >> 3), \
  (uint8_t)((uint32_t)value >> 2), \
  (uint8_t)((uint32_t)value >> 1), \
  (uint8_t)((uint32_t)value >> 0) \

constexpr COLOR COLOR_NO_COLOR = {
    .a = 0,
    .r = 0,
    .g = 0,
    .b = 0,
};


extern COLOR color_init(uint32_t value);

extern bool color_equals(COLOR a,COLOR b);
extern bool color_not_equals(COLOR a,COLOR b);