blob: 75d5deb0717223bdd21db848ef6166d9babb1427 (
plain)
| 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
 | #include "Common.h"
#include "cru/platform/Color.h"
#include "cru/platform/graphics/Factory.h"
#include "cru/platform/gui/UiApplication.h"
#include <random>
namespace cru::theme_builder::components {
std::unique_ptr<platform::graphics::ISolidColorBrush>
CreateRandomEditorBackgroundBrush() {
  static float current_hue = 0.0f;
  current_hue += 23.f;
  if (current_hue > 360.f) {
    current_hue -= 360.f;
  }
  return platform::gui::IUiApplication::GetInstance()
      ->GetGraphicsFactory()
      ->CreateSolidColorBrush(platform::HslColor(current_hue, 0.5f, 0.8f));
}
}  // namespace cru::theme_builder::components
 |