aboutsummaryrefslogtreecommitdiff
path: root/src/win/graph/win_brush.cpp
blob: 262c3302052d0c3778c50d4dee8097d0b9b90b77 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include "cru/win/graph/win_brush.hpp"

#include "cru/win/exception.hpp"
#include "cru/win/graph/d2d_util.hpp"
#include "cru/win/graph/graph_manager.hpp"

#include <cassert>

namespace cru::win::graph {
WinSolidColorBrush::WinSolidColorBrush(GraphManager* graph_manager,
                                       const ui::Color& color) {
  assert(graph_manager);
  ThrowIfFailed(graph_manager->GetD2D1DeviceContext()->CreateSolidColorBrush(
      util::Convert(color), &brush_));
}

ui::Color WinSolidColorBrush::GetColor() {
  return util::Convert(brush_->GetColor());
}
void WinSolidColorBrush::SetColor(const ui::Color& color) {
  brush_->SetColor(util::Convert(color));
}
}  // namespace cru::win::graph