From 3a589fe8ef6fc97d66f17904afaa915661d0e66e Mon Sep 17 00:00:00 2001 From: Thomas Fussell Date: Mon, 16 May 2016 19:31:44 -0400 Subject: [PATCH] define some built-in rgb colors, missing fill method --- source/serialization/tests/test_read.hpp | 2 +- source/styles/color.cpp | 40 ++++++++++++++++++++++++ source/styles/fill.cpp | 5 +++ 3 files changed, 46 insertions(+), 1 deletion(-) diff --git a/source/serialization/tests/test_read.hpp b/source/serialization/tests/test_read.hpp index ad6fc6ce..26eedc5f 100644 --- a/source/serialization/tests/test_read.hpp +++ b/source/serialization/tests/test_read.hpp @@ -29,7 +29,7 @@ public: return wb; } - + void test_read_standard_workbook() { TS_ASSERT_DIFFERS(standard_workbook(), nullptr); diff --git a/source/styles/color.cpp b/source/styles/color.cpp index a091942d..475adcf3 100644 --- a/source/styles/color.cpp +++ b/source/styles/color.cpp @@ -37,6 +37,46 @@ const color color::white() return color(color::type::rgb, "ffffffff"); } +const color color::red() +{ + return color(color::type::rgb, "ffff0000"); +} + +const color color::darkred() +{ + return color(color::type::rgb, "ff8b0000"); +} + +const color color::blue() +{ + return color(color::type::rgb, "ff0000ff"); +} + +const color color::darkblue() +{ + return color(color::type::rgb, "ff00008b"); +} + +const color color::green() +{ + return color(color::type::rgb, "ff00ff00"); +} + +const color color::darkgreen() +{ + return color(color::type::rgb, "ff008b00"); +} + +const color color::yellow() +{ + return color(color::type::rgb, "ffffff00"); +} + +const color color::darkyellow() +{ + return color(color::type::rgb, "ffcccc00"); +} + color::color() { } diff --git a/source/styles/fill.cpp b/source/styles/fill.cpp index e4a1b1ae..a526f2ba 100644 --- a/source/styles/fill.cpp +++ b/source/styles/fill.cpp @@ -267,4 +267,9 @@ double fill::get_gradient_bottom() const return gradient_path_bottom_; } +void fill::set_background_color(const color &c) +{ + background_color_ = c; +} + } // namespace xlnt