summaryrefslogtreecommitdiff
path: root/src/colour.hh
blob: 8362bb3d3dc6c3ea47061bb10a178418f6a2a9ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#ifndef COLOUR_HH
#define COLOUR_HH

#include <cstdint>

struct Colour {
  Colour();
  explicit Colour(uint32_t argb);
  Colour(uint8_t r, uint8_t g, uint8_t b);
  Colour(uint8_t a, uint8_t r, uint8_t g, uint8_t b);

  uint8_t alpha() const { return argb >> 24; };
  uint8_t red() const { return (argb >> 16) & 0xff; };
  uint8_t green() const { return (argb >> 8) & 0xff; };
  uint8_t blue() const { return argb & 0xff; };

  uint32_t argb;
};

#endif  // COLOUR_HH