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

Side by Side Diff: app/gfx/color_utils.h

Issue 198008: Merge 25340 - Add functions to alphablend two colors and pick the more readab... (Closed) Base URL: svn://chrome-svn/chrome/branches/195/src/
Patch Set: Created 11 years, 3 months 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | app/gfx/color_utils.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:mergeinfo
Merged /trunk/src/app/gfx/color_utils.h:r25340
Merged /branches/chrome_webkit_merge_branch/app/gfx/color_utils.h:r69-2775
OLDNEW
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
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_
OLDNEW
« no previous file with comments | « no previous file | app/gfx/color_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698