OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef APP_GFX_COLOR_UTILS_H_ | 5 #ifndef APP_GFX_COLOR_UTILS_H_ |
6 #define APP_GFX_COLOR_UTILS_H_ | 6 #define APP_GFX_COLOR_UTILS_H_ |
7 | 7 |
8 #include "third_party/skia/include/core/SkColor.h" | 8 #include "third_party/skia/include/core/SkColor.h" |
9 | 9 |
10 class SkBitmap; | 10 class SkBitmap; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 | 45 |
46 // Gets a color representing a bitmap. The definition of "representing" is the | 46 // Gets a color representing a bitmap. The definition of "representing" is the |
47 // average color in the bitmap. The color returned is modified to have the | 47 // average color in the bitmap. The color returned is modified to have the |
48 // specified alpha. | 48 // specified alpha. |
49 SkColor GetAverageColorOfFavicon(SkBitmap* bitmap, SkAlpha alpha); | 49 SkColor GetAverageColorOfFavicon(SkBitmap* bitmap, SkAlpha alpha); |
50 | 50 |
51 // Builds a histogram based on the Y' of the Y'UV representation of | 51 // Builds a histogram based on the Y' of the Y'UV representation of |
52 // this image. | 52 // this image. |
53 void BuildLumaHistogram(SkBitmap* bitmap, int histogram[256]); | 53 void BuildLumaHistogram(SkBitmap* bitmap, int histogram[256]); |
54 | 54 |
55 // Create a color from a base color and a specific alpha value. | 55 // Returns a blend of the supplied colors, ranging from |background| (for |
56 SkColor SetColorAlpha(SkColor c, SkAlpha alpha); | 56 // |alpha| == 0) to |foreground| (for |alpha| == 255). |
| 57 SkColor AlphaBlend(SkColor foreground, SkColor background, SkAlpha alpha); |
| 58 |
| 59 // Given two possible foreground colors, return the one that is more readable |
| 60 // over |background|. |
| 61 SkColor PickMoreReadableColor(SkColor foreground1, |
| 62 SkColor foreground2, |
| 63 SkColor background); |
57 | 64 |
58 // Gets a Windows system color as a SkColor | 65 // Gets a Windows system color as a SkColor |
59 SkColor GetSysSkColor(int which); | 66 SkColor GetSysSkColor(int which); |
60 | 67 |
61 } // namespace color_utils | 68 } // namespace color_utils |
62 | 69 |
63 #endif // #ifndef APP_GFX_COLOR_UTILS_H_ | 70 #endif // #ifndef APP_GFX_COLOR_UTILS_H_ |
OLD | NEW |