aboutsummaryrefslogtreecommitdiff
path: root/src/win/graph/win_brush.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/win/graph/win_brush.cpp')
-rw-r--r--src/win/graph/win_brush.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/win/graph/win_brush.cpp b/src/win/graph/win_brush.cpp
new file mode 100644
index 00000000..262c3302
--- /dev/null
+++ b/src/win/graph/win_brush.cpp
@@ -0,0 +1,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