Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 <string> | |
| 9 | |
| 8 #include "third_party/skia/include/core/SkColor.h" | 10 #include "third_party/skia/include/core/SkColor.h" |
| 9 #include "ui/gfx/gfx_export.h" | 11 #include "ui/gfx/gfx_export.h" |
| 10 | 12 |
| 11 class SkBitmap; | 13 class SkBitmap; |
| 12 | 14 |
| 13 namespace color_utils { | 15 namespace color_utils { |
| 14 | 16 |
| 15 // Represents an HSL color. | 17 // Represents an HSL color. |
| 16 struct HSL { | 18 struct HSL { |
| 17 double h; | 19 double h; |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 131 | 133 |
| 132 // Returns true only if Chrome should use an inverted color scheme - which is | 134 // Returns true only if Chrome should use an inverted color scheme - which is |
| 133 // only true if the system has high-contrast mode enabled and and is using a | 135 // only true if the system has high-contrast mode enabled and and is using a |
| 134 // light-on-dark color scheme. | 136 // light-on-dark color scheme. |
| 135 GFX_EXPORT bool IsInvertedColorScheme(); | 137 GFX_EXPORT bool IsInvertedColorScheme(); |
| 136 | 138 |
| 137 // Derives a color for icons on a UI surface based on the text color on the same | 139 // Derives a color for icons on a UI surface based on the text color on the same |
| 138 // surface. | 140 // surface. |
| 139 GFX_EXPORT SkColor DeriveDefaultIconColor(SkColor text_color); | 141 GFX_EXPORT SkColor DeriveDefaultIconColor(SkColor text_color); |
| 140 | 142 |
| 143 // Creates an rgba string for an SkColor. For example: 'rgba(255,0,255,0.5)'. | |
| 144 GFX_EXPORT std::string SkColorToRGBAString(SkColor color); | |
|
Dan Beam
2017/03/03 20:09:43
nit: SkColorToRgbaString()
RGBA -> Rgba
gonzalon
2017/03/03 20:20:04
Done.
| |
| 145 | |
| 146 // Creates an rgb string for an SkColor. For example: '255,0,255'. | |
| 147 GFX_EXPORT std::string SkColorToRGBString(SkColor color); | |
|
Dan Beam
2017/03/03 20:09:43
ToRgb
gonzalon
2017/03/03 20:20:05
Done.
| |
| 148 | |
| 141 } // namespace color_utils | 149 } // namespace color_utils |
| 142 | 150 |
| 143 #endif // UI_GFX_COLOR_UTILS_H_ | 151 #endif // UI_GFX_COLOR_UTILS_H_ |
| OLD | NEW |