rgb_keyboard_util.h 1.4 KB

123456789101112131415161718192021222324252627282930313233
  1. // Copyright 2022 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef ASH_RGB_KEYBOARD_RGB_KEYBOARD_UTIL_H_
  5. #define ASH_RGB_KEYBOARD_RGB_KEYBOARD_UTIL_H_
  6. #include "ash/ash_export.h"
  7. #include "ash/webui/personalization_app/mojom/personalization_app.mojom.h"
  8. namespace ash {
  9. inline constexpr SkColor kDefaultColor =
  10. SkColorSetRGB(/*r=*/255, /*g=*/255, /*b=*/210);
  11. // Util method to convert the |BacklightColor| enum to a predefined SkColor
  12. // which will be set by rgb keyboard manager to change the color of the keyboard
  13. // backlight.
  14. ASH_EXPORT SkColor ConvertBacklightColorToSkColor(
  15. personalization_app::mojom::BacklightColor backlight_color);
  16. // Util method to convert the |BacklightColor| enum to a |SkColor| that is used
  17. // as the background color for the rgb icon displayed in the system's keyboard
  18. // brightness slider. The color is different from the color returned by
  19. // |ConvertBacklightColorToSkColor| and matches the color displayed in the
  20. // personalization hub as the actual rgb keyboard colors appear to be visually
  21. // darker than what the UX wants to show to users.
  22. SkColor ConvertBacklightColorToIconBackgroundColor(
  23. personalization_app::mojom::BacklightColor backlight_color);
  24. } // namespace ash
  25. #endif // ASH_RGB_KEYBOARD_RGB_KEYBOARD_UTIL_H_