24bool HexCharToInt(
char symbol,
unsigned &val)
26 if (symbol >=
'0' && symbol <=
'9') {
59 for (; first < last; ++first) {
61 if (!HexCharToInt(rgb[first], val)) {
62 ::Error(
"ROOT::MacOSX::X11::GetGex",
63 "Bad symbol in color component, hex digit expected, got %c", rgb[first]);
66 component = (component << 4) | val;
78 if (colorName[0] ==
'#')
92 if (len < 4 || len > 13 || (
len - 1) % 3) {
94 ::Error(
"ROOT::MacOSX::X11::ParseRGBTriplet",
95 "Bad color name or rgb triplet %s", rgb.
Data());
103 unsigned r = 0,
g = 0,
b = 0;
104 if (GetHex(rgb, 1, compLen,
r) && GetHex(rgb, 1 + compLen, compLen,
g) &&
105 GetHex(rgb, 1 + compLen * 2, compLen,
b))
111 const unsigned bitPad = 16 - compLen * 4;
112 color.
fRed =
r << bitPad;
114 color.
fBlue =
b << bitPad;
125 TString lowerCaseName(colorName);
132 color.
fRed = it->second.fRed * 0xFFFF / 0xFF;
133 color.
fGreen = it->second.fGreen * 0xFFFF / 0xFF;
134 color.
fBlue = it->second.fBlue * 0xFFFF / 0xFF;
138 ::Error(
"ROOT::MacOSX::X11::ColorParser::LookupColorByName",
139 "Could not find color with name %s", colorName.
Data());
590 fX11RGB[
"light goldenrod yellow"] =
RGB_t(250, 250, 210);
913 tmpMap.insert(std::make_pair(key, iter->second));
922 rgb[0] = (pixelColor >> 16 & 0xff) / 255.;
923 rgb[1] = (pixelColor >> 8 & 0xff) / 255.;
924 rgb[2] = (pixelColor & 0xff) / 255.;
931 rgb[0] = pixelColor >> 16 & 0xff;
932 rgb[1] = pixelColor >> 8 & 0xff;
933 rgb[2] = pixelColor & 0xff;
ULong_t Pixel_t
Pixel value.
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t UChar_t len
bool ParseRGBTriplet(const TString &rgb, ColorStruct_t &color) const
std::map< TString, RGB_t > fX11RGB
rgb_map::const_iterator const_rgb_iterator
bool LookupColorByName(const TString &colorName, ColorStruct_t &color) const
std::map< TString, RGB_t > rgb_map
bool ParseColor(const TString &colorString, ColorStruct_t &color) const
void ToLower()
Change string to lower-case.
const char * Data() const
void PixelToRGB(Pixel_t pixelColor, CGFloat *rgb)
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
ULong_t fPixel
color pixel value (index in color table)
UShort_t fRed
red component (0..65535)
UShort_t fGreen
green component (0..65535)
UShort_t fBlue
blue component (0..65535)