forked from adamlaska/electron
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcolor_util.h
More file actions
26 lines (17 loc) · 755 Bytes
/
color_util.h
File metadata and controls
26 lines (17 loc) · 755 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// Copyright (c) 2016 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#ifndef ELECTRON_SHELL_COMMON_COLOR_UTIL_H_
#define ELECTRON_SHELL_COMMON_COLOR_UTIL_H_
#include <string>
#include "third_party/skia/include/core/SkColor.h"
namespace electron {
// Parses a CSS-style color string from hex, rgb(), rgba(),
// hsl(), hsla(), or color name formats.
SkColor ParseCSSColor(const std::string& color_string);
// Convert color to RGB hex value like "#RRGGBB".
std::string ToRGBHex(SkColor color);
// Convert color to RGBA hex value like "#RRGGBBAA".
std::string ToRGBAHex(SkColor color, bool include_hash = true);
} // namespace electron
#endif // ELECTRON_SHELL_COMMON_COLOR_UTIL_H_