aboutsummaryrefslogtreecommitdiffhomepage
path: root/color.cpp
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-03-13 14:22:53 -0700
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-03-13 14:23:10 -0700
commit52d8fb301c5107c448936efda650044c5d27605a (patch)
tree9f5bf68157f9dda0ba14f3e5f9eba5a334aff36d /color.cpp
parentdfe159e7192748bb03b0b58ef67f0a999c2bec82 (diff)
Added term256 support to set_color tool
Diffstat (limited to 'color.cpp')
-rw-r--r--color.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/color.cpp b/color.cpp
index b6ffcb60..c739f3f3 100644
--- a/color.cpp
+++ b/color.cpp
@@ -223,7 +223,7 @@ unsigned char rgb_color_t::to_name_index() const {
}
}
-rgb_color_t::rgb_color_t(const wcstring &str) {
+void rgb_color_t::parse(const wcstring &str) {
bool success = false;
if (! success) success = try_parse_special(str);
if (! success) success = try_parse_named(str);
@@ -245,6 +245,14 @@ rgb_color_t::rgb_color_t(const wcstring &str) {
}
}
+rgb_color_t::rgb_color_t(const wcstring &str) {
+ this->parse(str);
+}
+
+rgb_color_t::rgb_color_t(const std::string &str) {
+ this->parse(str2wcstring(str));
+}
+
wcstring rgb_color_t::description() const {
switch (type) {
case type_none: