aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/color.cc19
-rw-r--r--src/color.h26
2 files changed, 13 insertions, 32 deletions
diff --git a/src/color.cc b/src/color.cc
deleted file mode 100644
index 9af409a..0000000
--- a/src/color.cc
+++ /dev/null
@@ -1,19 +0,0 @@
-#include "color.h"
-
-namespace imgen {
-
-color red() { return color{255, 0, 0}; }
-color lime() { return color{ 0, 255, 0}; }
-color blue() { return color{ 0, 0, 255}; }
-color yellow() { return color{255, 255, 0}; }
-color cyan() { return color{ 0, 255, 255}; }
-color magenta() { return color{255, 0, 255}; }
-color silver() { return color{192, 192, 192}; }
-color maroon() { return color{128, 0, 0}; }
-color olive() { return color{128, 128, 0}; }
-color green() { return color{ 0, 128, 0}; }
-color purple() { return color{128, 0, 128}; }
-color teal() { return color{ 0, 128, 128}; }
-color navy() { return color{ 0, 0, 128}; }
-
-}
diff --git a/src/color.h b/src/color.h
index 2c35465..514c739 100644
--- a/src/color.h
+++ b/src/color.h
@@ -7,18 +7,18 @@ namespace imgen {
using color = std::tuple<std::uint8_t, std::uint8_t, std::uint8_t>;
-color red();
-color lime();
-color blue();
-color yellow();
-color cyan();
-color magenta();
-color silver();
-color maroon();
-color olive();
-color green();
-color purple();
-color teal();
-color navy();
+constexpr color red() { return color{255, 0, 0}; }
+constexpr color lime() { return color{ 0, 255, 0}; }
+constexpr color blue() { return color{ 0, 0, 255}; }
+constexpr color yellow() { return color{255, 255, 0}; }
+constexpr color cyan() { return color{ 0, 255, 255}; }
+constexpr color magenta() { return color{255, 0, 255}; }
+constexpr color silver() { return color{192, 192, 192}; }
+constexpr color maroon() { return color{128, 0, 0}; }
+constexpr color olive() { return color{128, 128, 0}; }
+constexpr color green() { return color{ 0, 128, 0}; }
+constexpr color purple() { return color{128, 0, 128}; }
+constexpr color teal() { return color{ 0, 128, 128}; }
+constexpr color navy() { return color{ 0, 0, 128}; }
}