11#ifndef OPENXLSX_XLCOLOR_HPP
12#define OPENXLSX_XLCOLOR_HPP
16# pragma warning(disable : 4251)
17# pragma warning(disable : 4275)
25#include "OpenXLSX-Exports.hpp"
55 explicit XLColor(std::string_view hexCode);
80 void set(std::string_view hexCode);
85 [[nodiscard]] uint8_t
alpha()
const;
90 [[nodiscard]] uint8_t
red()
const;
95 [[nodiscard]] uint8_t
green()
const;
100 [[nodiscard]] uint8_t
blue()
const;
105 [[nodiscard]] std::string
hex()
const;
108 uint8_t m_alpha{255};
XLColor & operator=(const XLColor &other)
uint8_t red() const
Retrieves the red channel value.
Definition XLColor.cpp:130
void set(uint8_t alpha, uint8_t red, uint8_t green, uint8_t blue)
Sets explicit ARGB channels.
Definition XLColor.cpp:70
XLColor(XLColor &&other) noexcept
uint8_t alpha() const
Retrieves the alpha (opacity) channel value.
Definition XLColor.cpp:125
std::string hex() const
Returns the 8-character ARGB hex string representation used in OOXML (e.g., "FFFF0000").
Definition XLColor.cpp:147
XLColor()
Default constructor. Initializes to opaque black (A=255, R=0, G=0, B=0).
uint8_t blue() const
Retrieves the blue channel value.
Definition XLColor.cpp:140
friend bool operator!=(const XLColor &lhs, const XLColor &rhs)
Checks if two colors differ in any of their ARGB channels.
Definition XLColor.hpp:130
friend bool operator==(const XLColor &lhs, const XLColor &rhs)
Checks if two colors have identical ARGB channels.
Definition XLColor.hpp:124
uint8_t green() const
Retrieves the green channel value.
Definition XLColor.cpp:135
XLColor & operator=(XLColor &&other) noexcept
XLColor(const XLColor &other)
Definition IXLCellProvider.hpp:24
bool operator==(const XLCell &lhs, const XLCell &rhs)
Definition XLCell.hpp:314
bool operator!=(const XLCell &lhs, const XLCell &rhs)
Definition XLCell.hpp:321