Chromium Code Reviews| Index: chrome/browser/ui/webui/color_utils.h |
| diff --git a/chrome/browser/ui/webui/color_utils.h b/chrome/browser/ui/webui/color_utils.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..24e9582d417b192aa2e980ba43dd8b3867f4925f |
| --- /dev/null |
| +++ b/chrome/browser/ui/webui/color_utils.h |
| @@ -0,0 +1,29 @@ |
| +// Copyright 2017 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_UI_WEBUI_COLOR_UTILS_H_ |
| +#define CHROME_BROWSER_UI_WEBUI_COLOR_UTILS_H_ |
| + |
| +#include <string> |
| + |
| +#include "base/macros.h" |
| +#include "third_party/skia/include/core/SkColor.h" |
| + |
|
pkotwicz
2017/02/27 20:50:59
Nit: ui/gfx/color_utils.h is probably a better hom
gonzalon
2017/02/27 21:33:17
Done.
|
| +class ColorUtils { |
| + public: |
| + // Creates an rgba string for an SkColor. |
| + static std::string SkColorToRGBAString(SkColor color); |
| + |
| + // Creates an rgba string for a color represented as an int64. |
| + static std::string ColorToString(int64_t color); |
|
pkotwicz
2017/02/27 20:50:59
I think that this method should remain an implemen
gonzalon
2017/02/27 21:33:17
It was mostly a convenience function to avoid havi
|
| + |
| + // Creates an rgb string for an SkColor, but leaves the alpha blank so that |
| + // the css can fill it in. |
| + static std::string SkColorToRGBComponents(SkColor color); |
| + |
| + private: |
| + DISALLOW_COPY_AND_ASSIGN(ColorUtils); |
| +}; |
| + |
| +#endif // CHROME_BROWSER_UI_WEBUI_COLOR_UTILS_H_ |