color_util.h 609 B

123456789101112131415161718192021222324
  1. // Copyright (c) 2016 GitHub, Inc.
  2. // Use of this source code is governed by the MIT license that can be
  3. // found in the LICENSE file.
  4. #ifndef SHELL_COMMON_COLOR_UTIL_H_
  5. #define SHELL_COMMON_COLOR_UTIL_H_
  6. #include <string>
  7. #include "third_party/skia/include/core/SkColor.h"
  8. namespace electron {
  9. // Parse hex color like "#FFF" or "#EFEFEF"
  10. SkColor ParseHexColor(const std::string& name);
  11. // Convert color to RGB hex value like "#ABCDEF"
  12. std::string ToRGBHex(SkColor color);
  13. std::string ToRGBAHex(SkColor color, bool include_hash = true);
  14. } // namespace electron
  15. #endif // SHELL_COMMON_COLOR_UTIL_H_