Home | History | Annotate | Download | only in graphics

Lines Matching refs:Color

27 #include "Color.h"
42 const RGBA32 Color::black;
43 const RGBA32 Color::white;
44 const RGBA32 Color::darkGray;
45 const RGBA32 Color::gray;
46 const RGBA32 Color::lightGray;
47 const RGBA32 Color::transparent;
74 RGBA32 colorWithOverrideAlpha(RGBA32 color, float overrideAlpha)
76 RGBA32 rgbOnly = color & 0x00FFFFFF;
96 // Explanation of this algorithm can be found in the CSS3 Color Module
97 // specification at http://www.w3.org/TR/css3-color/#hsl-color with further
129 bool Color::parseHexColor(const String& name, RGBA32& rgb)
153 int differenceSquared(const Color& c1, const Color& c2)
161 Color::Color(const String& name)
169 Color::Color(const char* name)
181 String Color::name() const
190 char buffer[64]; // easily big enough for the longest color name
204 void Color::setNamedColor(const String& name)
212 Color Color::light() const
227 return Color(0x54, 0x54, 0x54, alpha());
231 return Color(static_cast<int>(multiplier * r * scaleFactor),
237 Color Color::dark() const
251 return Color(static_cast<int>(multiplier * r * scaleFactor),
270 Color Color::blend(const Color& source) const
283 return Color(r, g, b, a);
286 Color Color::blendWithWhite() const
288 // If the color contains alpha already, we leave it alone.
292 Color newColor;
294 // We have a solid color. Convert to an equivalent color that looks the same when blended with white
300 newColor = Color(r, g, b, alpha);
308 void Color::getRGBA(float& r, float& g, float& b, float& a) const
316 void Color::getRGBA(double& r, double& g, double& b, double& a) const
324 void Color::getHSL(double& hue, double& saturation, double& lightness) const
359 Color colorFromPremultipliedARGB(unsigned pixelColor)
371 return Color(rgba);
374 unsigned premultipliedARGBFromColor(const Color& color)
378 if (unsigned alpha = color.alpha()) {
380 ((color.red() * alpha + 254) / 255) << 16 |
381 ((color.green() * alpha + 254) / 255) << 8 |
382 ((color.blue() * alpha + 254) / 255);
384 pixelColor = color.rgb();