32 #include <xlnt/xlnt_config.hpp> 33 #include <xlnt/utils/optional.hpp> 34 #include <xlnt/utils/hash_combine.hpp> 53 std::size_t index()
const;
58 void index(std::size_t index);
81 std::size_t index()
const;
86 void index(std::size_t index);
104 rgb_color(
const std::string &hex_string);
110 rgb_color(std::uint8_t r, std::uint8_t g, std::uint8_t b, std::uint8_t a = 255);
115 std::string hex_string()
const;
120 std::uint8_t red()
const;
125 std::uint8_t green()
const;
130 std::uint8_t blue()
const;
135 std::uint8_t alpha()
const;
140 std::array<std::uint8_t, 3> rgb()
const;
145 std::array<std::uint8_t, 4> rgba()
const;
151 std::array<std::uint8_t, 4> rgba_;
173 static const color black();
178 static const color white();
183 static const color red();
188 static const color darkred();
193 static const color blue();
198 static const color darkblue();
203 static const color green();
208 static const color darkgreen();
213 static const color yellow();
218 static const color darkyellow();
253 void auto_(
bool value);
294 bool has_tint()
const;
304 void tint(
double tint);
350 bool auto_color =
false;
365 xlnt::detail::hash_combine(seed, static_cast<int>(c.
type()));
368 xlnt::detail::hash_combine(seed, c.
auto_());
373 xlnt::detail::hash_combine(seed, c.
tint());
378 case xlnt::color_type::indexed:
381 case xlnt::color_type::theme:
382 xlnt::detail::hash_combine(seed, c.
theme().
index());
384 case xlnt::color_type::rgb:
386 const auto& rgb = c.
rgb();
387 xlnt::detail::hash_combine(seed, rgb.red());
388 xlnt::detail::hash_combine(seed, rgb.green());
389 xlnt::detail::hash_combine(seed, rgb.blue());
390 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. If this is not an RGB color...
Definition: cell_reference.hpp:261
const theme_color & theme() const
Returns the internal indexed color representing this color. If this is not a theme color...
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:167
color_type
Some colors are references to colors rather than having a particular RGB value.
Definition: color.hpp:157
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. If this is not an indexed color...
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:41
bool has_tint() const
Returns true if tint is set
A theme color encapsulates a color derived from the theme.
Definition: color.hpp:70
An RGB color describes a color in terms of its red, green, blue, and alpha components.
Definition: color.hpp:98
color_type type() const
Returns the type of this color