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

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

Issue 1448433004: [MD] update EV bubble icon and location bar https icons (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix build.gn Created 5 years, 1 month 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
« no previous file with comments | « ui/gfx/BUILD.gn ('k') | ui/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')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 UI_GFX_COLOR_UTILS_H_ 5 #ifndef UI_GFX_COLOR_UTILS_H_
6 #define UI_GFX_COLOR_UTILS_H_ 6 #define UI_GFX_COLOR_UTILS_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "third_party/skia/include/core/SkColor.h" 9 #include "third_party/skia/include/core/SkColor.h"
10 #include "ui/gfx/gfx_export.h" 10 #include "ui/gfx/gfx_export.h"
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 // bitmap are all the same brightness. 81 // bitmap are all the same brightness.
82 GFX_EXPORT double CalculateBoringScore(const SkBitmap& bitmap); 82 GFX_EXPORT double CalculateBoringScore(const SkBitmap& bitmap);
83 83
84 // Returns a blend of the supplied colors, ranging from |background| (for 84 // Returns a blend of the supplied colors, ranging from |background| (for
85 // |alpha| == 0) to |foreground| (for |alpha| == 255). The alpha channels of 85 // |alpha| == 0) to |foreground| (for |alpha| == 255). The alpha channels of
86 // the supplied colors are also taken into account, so the returned color may 86 // the supplied colors are also taken into account, so the returned color may
87 // be partially transparent. 87 // be partially transparent.
88 GFX_EXPORT SkColor AlphaBlend(SkColor foreground, SkColor background, 88 GFX_EXPORT SkColor AlphaBlend(SkColor foreground, SkColor background,
89 SkAlpha alpha); 89 SkAlpha alpha);
90 90
91 // Returns true if the luminance of |color| is closer to black than white.
92 GFX_EXPORT bool IsDark(SkColor color);
93
91 // Makes a dark color lighter or a light color darker by blending |color| with 94 // Makes a dark color lighter or a light color darker by blending |color| with
92 // white or black depending on its current luminance. |alpha| controls the 95 // white or black depending on its current luminance. |alpha| controls the
93 // amount of white or black that will be alpha-blended into |color|. 96 // amount of white or black that will be alpha-blended into |color|.
94 GFX_EXPORT SkColor BlendTowardOppositeLuminance(SkColor color, SkAlpha alpha); 97 GFX_EXPORT SkColor BlendTowardOppositeLuminance(SkColor color, SkAlpha alpha);
95 98
96 // Given an opaque foreground and background color, try to return a foreground 99 // Given an opaque foreground and background color, try to return a foreground
97 // color that is "readable" over the background color by luma-inverting the 100 // color that is "readable" over the background color by luma-inverting the
98 // foreground color and then picking whichever foreground color has higher 101 // foreground color and then picking whichever foreground color has higher
99 // contrast against the background color. You should not pass colors with 102 // contrast against the background color. You should not pass colors with
100 // non-255 alpha to this routine, since determining the correct behavior in such 103 // non-255 alpha to this routine, since determining the correct behavior in such
(...skipping 14 matching lines...) Expand all
115 // light-on-dark color scheme. 118 // light-on-dark color scheme.
116 GFX_EXPORT bool IsInvertedColorScheme(); 119 GFX_EXPORT bool IsInvertedColorScheme();
117 120
118 // Derives a color for icons on a UI surface based on the text color on the same 121 // Derives a color for icons on a UI surface based on the text color on the same
119 // surface. 122 // surface.
120 GFX_EXPORT SkColor DeriveDefaultIconColor(SkColor text_color); 123 GFX_EXPORT SkColor DeriveDefaultIconColor(SkColor text_color);
121 124
122 } // namespace color_utils 125 } // namespace color_utils
123 126
124 #endif // UI_GFX_COLOR_UTILS_H_ 127 #endif // UI_GFX_COLOR_UTILS_H_
OLDNEW
« no previous file with comments | « ui/gfx/BUILD.gn ('k') | ui/gfx/color_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698