diff options
author | ridiculousfish <corydoras@ridiculousfish.com> | 2014-09-19 15:37:31 -0700 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2014-09-19 18:45:04 -0700 |
commit | 555ff00a30b70cb84a767b60e3a5c7015815feae (patch) | |
tree | ac196a147b942c345fa5ebd802ca5add774b8139 /color.h | |
parent | 6083c6fc725727ebb25c209931a38504f9269c5c (diff) |
Initial work to support for term-24bit ("true color")
Diffstat (limited to 'color.h')
-rw-r--r-- | color.h | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -8,6 +8,10 @@ #include "config.h" #include "common.h" +/* 24 bit color */ +struct color24_t { + unsigned char rgb[3]; +}; /* A type that represents a color. We work hard to keep it at a size of 4 bytes. */ class rgb_color_t @@ -36,7 +40,7 @@ class rgb_color_t union { unsigned char name_idx; //0-10 - unsigned char rgb[3]; + color24_t color; } data; /** Try parsing a special color name like "normal" */ @@ -129,9 +133,12 @@ public: /** Returns the name index for the given color. Requires that the color be named or RGB. */ unsigned char to_name_index() const; - /** Returns the term256 index for the given color. Requires that the color be named or RGB. */ + /** Returns the term256 index for the given color. Requires that the color be RGB. */ unsigned char to_term256_index() const; + /** Returns the 24 bit color for the given color. Requires that the color be RGB. */ + color24_t to_color24() const; + /** Returns whether the color is bold */ bool is_bold() const { |