Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(80)

Side by Side Diff: sky/engine/platform/graphics/Color.h

Issue 756183004: Get rid of background-clip:text and PaintBehaviorForceBlackText. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Remove forceBlackText Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2003, 2004, 2005, 2006, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2003, 2004, 2005, 2006, 2010 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 27 matching lines...) Expand all
38 typedef unsigned RGBA32; // RGBA quadruplet 38 typedef unsigned RGBA32; // RGBA quadruplet
39 39
40 PLATFORM_EXPORT RGBA32 makeRGB(int r, int g, int b); 40 PLATFORM_EXPORT RGBA32 makeRGB(int r, int g, int b);
41 PLATFORM_EXPORT RGBA32 makeRGBA(int r, int g, int b, int a); 41 PLATFORM_EXPORT RGBA32 makeRGBA(int r, int g, int b, int a);
42 42
43 PLATFORM_EXPORT RGBA32 colorWithOverrideAlpha(RGBA32 color, float overrideAlpha) ; 43 PLATFORM_EXPORT RGBA32 colorWithOverrideAlpha(RGBA32 color, float overrideAlpha) ;
44 PLATFORM_EXPORT RGBA32 makeRGBA32FromFloats(float r, float g, float b, float a); 44 PLATFORM_EXPORT RGBA32 makeRGBA32FromFloats(float r, float g, float b, float a);
45 PLATFORM_EXPORT RGBA32 makeRGBAFromHSLA(double h, double s, double l, double a); 45 PLATFORM_EXPORT RGBA32 makeRGBAFromHSLA(double h, double s, double l, double a);
46 PLATFORM_EXPORT RGBA32 makeRGBAFromCMYKA(float c, float m, float y, float k, flo at a); 46 PLATFORM_EXPORT RGBA32 makeRGBAFromCMYKA(float c, float m, float y, float k, flo at a);
47 47
48 PLATFORM_EXPORT int differenceSquared(const Color&, const Color&);
49
50 inline int redChannel(RGBA32 color) { return (color >> 16) & 0xFF; } 48 inline int redChannel(RGBA32 color) { return (color >> 16) & 0xFF; }
51 inline int greenChannel(RGBA32 color) { return (color >> 8) & 0xFF; } 49 inline int greenChannel(RGBA32 color) { return (color >> 8) & 0xFF; }
52 inline int blueChannel(RGBA32 color) { return color & 0xFF; } 50 inline int blueChannel(RGBA32 color) { return color & 0xFF; }
53 inline int alphaChannel(RGBA32 color) { return (color >> 24) & 0xFF; } 51 inline int alphaChannel(RGBA32 color) { return (color >> 24) & 0xFF; }
54 52
55 struct NamedColor { 53 struct NamedColor {
56 const char* name; 54 const char* name;
57 unsigned ARGBValue; 55 unsigned ARGBValue;
58 }; 56 };
59 57
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 } 165 }
168 166
169 return Color(blend(from.red(), to.red(), progress), 167 return Color(blend(from.red(), to.red(), progress),
170 blend(from.green(), to.green(), progress), 168 blend(from.green(), to.green(), progress),
171 blend(from.blue(), to.blue(), progress), 169 blend(from.blue(), to.blue(), progress),
172 blend(from.alpha(), to.alpha(), progress)); 170 blend(from.alpha(), to.alpha(), progress));
173 } 171 }
174 } // namespace blink 172 } // namespace blink
175 173
176 #endif // SKY_ENGINE_PLATFORM_GRAPHICS_COLOR_H_ 174 #endif // SKY_ENGINE_PLATFORM_GRAPHICS_COLOR_H_
OLDNEW
« no previous file with comments | « sky/engine/core/rendering/style/RenderStyleConstants.h ('k') | sky/engine/platform/graphics/Color.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698