aboutsummaryrefslogtreecommitdiff
path: root/src/win/graph/win_brush.cpp
blob: 0c783366e9d07d64b65b71e4fe041a8dd2ef6c65 (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/win_native_factory.hpp"
#include "cru/win/graph/util/convert_util.hpp"

#include <cassert>

namespace cru::win::graph {
WinSolidColorBrush::WinSolidColorBrush(IWinNativeFactory* factory,
                                       const ui::Color& color) {
  assert(factory);
  ThrowIfFailed(factory->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