| 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 27 matching lines...) Expand all Loading... |
| 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 Loading... |
| 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_ |
| OLD | NEW |