OLD | NEW |
---|---|
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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
115 | 115 |
116 Color light() const; | 116 Color light() const; |
117 Color dark() const; | 117 Color dark() const; |
118 | 118 |
119 Color combineWithAlpha(float otherAlpha) const; | 119 Color combineWithAlpha(float otherAlpha) const; |
120 | 120 |
121 // This is an implementation of Porter-Duff's "source-over" equation | 121 // This is an implementation of Porter-Duff's "source-over" equation |
122 Color blend(const Color&) const; | 122 Color blend(const Color&) const; |
123 Color blendWithWhite() const; | 123 Color blendWithWhite() const; |
124 | 124 |
125 // Convert a Color assumed to be in the device RGB space into a Color in | |
126 // linear RGB space. | |
127 Color convertToLinear() const; | |
f(malita)
2014/01/22 15:09:32
This is just a bit odd - Color feels too low-level
| |
128 | |
125 static bool parseHexColor(const String&, RGBA32&); | 129 static bool parseHexColor(const String&, RGBA32&); |
126 static bool parseHexColor(const LChar*, unsigned, RGBA32&); | 130 static bool parseHexColor(const LChar*, unsigned, RGBA32&); |
127 static bool parseHexColor(const UChar*, unsigned, RGBA32&); | 131 static bool parseHexColor(const UChar*, unsigned, RGBA32&); |
128 | 132 |
129 static const RGBA32 black = 0xFF000000; | 133 static const RGBA32 black = 0xFF000000; |
130 static const RGBA32 white = 0xFFFFFFFF; | 134 static const RGBA32 white = 0xFFFFFFFF; |
131 static const RGBA32 darkGray = 0xFF808080; | 135 static const RGBA32 darkGray = 0xFF808080; |
132 static const RGBA32 gray = 0xFFA0A0A0; | 136 static const RGBA32 gray = 0xFFA0A0A0; |
133 static const RGBA32 lightGray = 0xFFC0C0C0; | 137 static const RGBA32 lightGray = 0xFFC0C0C0; |
134 static const RGBA32 transparent = 0x00000000; | 138 static const RGBA32 transparent = 0x00000000; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
167 } | 171 } |
168 | 172 |
169 return Color(blend(from.red(), to.red(), progress), | 173 return Color(blend(from.red(), to.red(), progress), |
170 blend(from.green(), to.green(), progress), | 174 blend(from.green(), to.green(), progress), |
171 blend(from.blue(), to.blue(), progress), | 175 blend(from.blue(), to.blue(), progress), |
172 blend(from.alpha(), to.alpha(), progress)); | 176 blend(from.alpha(), to.alpha(), progress)); |
173 } | 177 } |
174 } // namespace WebCore | 178 } // namespace WebCore |
175 | 179 |
176 #endif // Color_h | 180 #endif // Color_h |
OLD | NEW |