From 8143b86fece2d9be45113db8a1781231ac67c2a2 Mon Sep 17 00:00:00 2001 From: Mathias Gumz Date: Sun, 13 Jan 2013 12:25:00 +0100 Subject: improved code documentation --- src/FbTk/Color.cc | 16 ++-------------- src/FbTk/Color.hh | 1 + 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/src/FbTk/Color.cc b/src/FbTk/Color.cc index b2d61ec..ea3f04e 100644 --- a/src/FbTk/Color.cc +++ b/src/FbTk/Color.cc @@ -31,14 +31,6 @@ using std::cerr; using std::endl; using std::string; -namespace { - -inline unsigned char maxValue(unsigned short colval) { - return colval == 65535 ? 0xFF : static_cast(colval/0xFF); -} - -} - namespace FbTk { Color::Color(): @@ -96,9 +88,7 @@ bool Color::setFromString(const char *color_string, int screen) { return false; setPixel(color.pixel); - setRGB(maxValue(color.red), - maxValue(color.green), - maxValue(color.blue)); + setRGB(color.red / 256, color.green / 256, color.blue / 256); setAllocated(true); m_screen = screen; @@ -168,9 +158,7 @@ void Color::allocate(unsigned short red, unsigned short green, unsigned short bl cerr<<"FbTk::Color: "<<_FBTK_CONSOLETEXT(Error, ColorAllocation, "Allocation error.", "XAllocColor failed...")<