63 const static int default_alpha;
64 const static std::array<const RGBA, 10> defaults;
65 const static RGBA black;
66 const static RGBA white;
72 RGBA(
int r,
int g,
int b,
int a = default_alpha) noexcept;
82 return {
static_cast<float>(m_r), static_cast<float>(m_g),
83 static_cast<float>(m_b), static_cast<float>(m_a)};
90 int r()
const noexcept;
93 int g()
const noexcept;
96 int b()
const noexcept;
99 int a()
const noexcept;
102 RGBA &
r(
int r) noexcept;
105 RGBA &
g(
int g) noexcept;
108 RGBA &
b(
int b) noexcept;
115 bool operator!=(
const RGBA &b)
const noexcept;
120 std::vector<Vector<float, 3>> m_colors;
127 RGBA to_color(
float i)
const;
int r() const noexcept
Get the current red value.
Definition: Colors.cpp:54
a linear segmented colormap
Definition: Colors.hpp:119
Definition: Colors.hpp:130
int a() const noexcept
Get the current alpha value.
Definition: Colors.cpp:57
static const Colormap viridis
https://github.com/BIDS/colormap/blob/master/option_d.py
Definition: Colors.hpp:131
An N-dimensional vector class.
Definition: Vector.hpp:59
std::string to_rgb_string() const noexcept
convert to an rgb string of form #rrggbb
Definition: Colors.cpp:79
bool operator==(const RGBA &b) const noexcept
Equality comparison.
Definition: Colors.cpp:88
Colour class with red, green, blue and alpha in range 0 to 255.
Definition: Colors.hpp:48
int b() const noexcept
Get the current blue value.
Definition: Colors.cpp:56
int g() const noexcept
Get the current green value.
Definition: Colors.cpp:55
RGBA()=default
default constructor
Definition: Backend.cpp:39