32 #include <xlnt/xlnt_config.hpp> 33 #include <xlnt/utils/optional.hpp> 34 #include <xlnt/utils/hash_combine.hpp> 35 #include <xlnt/utils/value_with_default.h> 60 std::size_t index()
const;
65 void index(std::size_t index);
88 std::size_t index()
const;
93 void index(std::size_t index);
111 rgb_color(
const std::string &hex_string);
117 rgb_color(std::uint8_t r, std::uint8_t g, std::uint8_t b, std::uint8_t a = 255);
122 std::string hex_string()
const;
127 std::uint8_t red()
const;
132 std::uint8_t green()
const;
137 std::uint8_t blue()
const;
142 std::uint8_t alpha()
const;
147 std::array<std::uint8_t, 3> rgb()
const;
152 std::array<std::uint8_t, 4> rgba()
const;
158 std::array<std::uint8_t, 4> rgba_;
180 static const color black();
185 static const color white();
190 static const color red();
195 static const color darkred();
200 static const color blue();
205 static const color darkblue();
210 static const color green();
215 static const color darkgreen();
220 static const color yellow();
225 static const color darkyellow();
260 void auto_(
bool value);
307 bool has_tint()
const;
317 void tint(
double tint);
330 friend class detail::xlsx_producer;
365 bool auto_color =
false;
380 xlnt::detail::hash_combine(seed, static_cast<int>(c.
type()));
383 xlnt::detail::hash_combine(seed, c.
auto_());
388 xlnt::detail::hash_combine(seed, c.
tint());
393 case xlnt::color_type::indexed:
396 case xlnt::color_type::theme:
397 xlnt::detail::hash_combine(seed, c.
theme().
index());
399 case xlnt::color_type::rgb:
401 const auto& rgb = c.
rgb();
402 xlnt::detail::hash_combine(seed, rgb.red());
403 xlnt::detail::hash_combine(seed, rgb.green());
404 xlnt::detail::hash_combine(seed, rgb.blue());
405 xlnt::detail::hash_combine(seed, rgb.alpha());
std::size_t index() const
Returns the index this color points to.
std::size_t index() const
Returns the index of the color in the theme this points to.
const rgb_color & rgb() const
Returns the internal indexed color representing this color. Assumes that this is an RGB color (to che...
Definition: cell_reference.hpp:288
const theme_color & theme() const
Returns the internal indexed color representing this color. Assumes that this is a theme color (to ch...
Enumerates the possible types a cell can be determined by it's current value.
Definition: cell.hpp:36
bool operator!=(std::nullptr_t, const cell &cell)
Returns true if this cell is initialized.
bool auto_() const
Returns true if this color has been set to auto
Colors can be applied to many parts of a cell's style.
Definition: color.hpp:174
color_type
Some colors are references to colors rather than having a particular RGB value.
Definition: color.hpp:164
Encapsulates a value with a default value
Definition: value_with_default.h:59
bool operator==(std::nullptr_t, const cell &cell)
Returns true if this cell is uninitialized.
A theme is a combination of fonts, colors, and effects. This isn't really supported yet...
Definition: theme.hpp:35
const indexed_color & indexed() const
Returns the internal indexed color representing this color. Assumes that this is an indexed color (to...
double tint() const
Returns the tint of this color.
An indexed color encapsulates a simple index to a color in the indexedColors of the stylesheet...
Definition: color.hpp:48
bool has_tint() const
Returns true if tint is set
A theme color encapsulates a color derived from the theme.
Definition: color.hpp:77
An RGB color describes a color in terms of its red, green, blue, and alpha components.
Definition: color.hpp:105
color_type type() const
Returns the type of this color