summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/FbTk/Color.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/FbTk/Color.cc b/src/FbTk/Color.cc
index c33e692..d969a43 100644
--- a/src/FbTk/Color.cc
+++ b/src/FbTk/Color.cc
@@ -19,11 +19,12 @@
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE. 20// DEALINGS IN THE SOFTWARE.
21 21
22// $Id: Color.cc,v 1.7 2004/01/09 01:54:37 fluxgen Exp $ 22// $Id: Color.cc,v 1.8 2004/01/09 21:36:21 fluxgen Exp $
23 23
24#include "Color.hh" 24#include "Color.hh"
25 25
26#include "App.hh" 26#include "App.hh"
27#include "StringUtil.hh"
27 28
28#include <iostream> 29#include <iostream>
29using namespace std; 30using namespace std;
@@ -80,13 +81,16 @@ bool Color::setFromString(const char *color_string, int screen) {
80 free(); 81 free();
81 return false; 82 return false;
82 } 83 }
84 string color_string_tmp = color_string;
85 StringUtil::removeFirstWhitespace(color_string_tmp);
86 StringUtil::removeTrailingWhitespace(color_string_tmp);
83 87
84 Display *disp = App::instance()->display(); 88 Display *disp = App::instance()->display();
85 Colormap colm = DefaultColormap(disp, screen); 89 Colormap colm = DefaultColormap(disp, screen);
86 90
87 XColor color; 91 XColor color;
88 92
89 if (! XParseColor(disp, colm, color_string, &color)) 93 if (! XParseColor(disp, colm, color_string_tmp.c_str(), &color))
90 return false; 94 return false;
91 else if (! XAllocColor(disp, colm, &color)) 95 else if (! XAllocColor(disp, colm, &color))
92 return false; 96 return false;