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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 static Color createUnchecked(int r, int g, int b, int a) | 81 static Color createUnchecked(int r, int g, int b, int a) |
82 { | 82 { |
83 RGBA32 color = a << 24 | r << 16 | g << 8 | b; | 83 RGBA32 color = a << 24 | r << 16 | g << 8 | b; |
84 return Color(color); | 84 return Color(color); |
85 } | 85 } |
86 | 86 |
87 // Returns the color serialized according to HTML5 | 87 // Returns the color serialized according to HTML5 |
88 // - http://www.whatwg.org/specs/web-apps/current-work/#serialization-of-a-c
olor | 88 // - http://www.whatwg.org/specs/web-apps/current-work/#serialization-of-a-c
olor |
89 String serialized() const; | 89 String serialized() const; |
90 | 90 |
| 91 // Returns the color serialized according to CSSOM |
| 92 // - http://dev.w3.org/csswg/cssom/#serialize-a-css-component-value |
| 93 String serializedAsCSSComponentValue() const; |
| 94 |
91 // Returns the color serialized as either #RRGGBB or #RRGGBBAA | 95 // Returns the color serialized as either #RRGGBB or #RRGGBBAA |
92 // The latter format is not a valid CSS color, and should only be seen in DR
T dumps. | 96 // The latter format is not a valid CSS color, and should only be seen in DR
T dumps. |
93 String nameForRenderTreeAsText() const; | 97 String nameForRenderTreeAsText() const; |
94 | 98 |
95 void setNamedColor(const String&); | 99 void setNamedColor(const String&); |
96 | 100 |
97 bool isValid() const { return m_valid; } | 101 bool isValid() const { return m_valid; } |
98 | 102 |
99 bool hasAlpha() const { return alpha() < 255; } | 103 bool hasAlpha() const { return alpha() < 255; } |
100 | 104 |
(...skipping 66 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 |