mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2025-09-15 23:48:15 +08:00
Add an UDL for combined hex RGB colors (#203)
In order to allow using the literal on its own it has been put into the inline namespace `literals`.
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
#define FTXUI_SCREEN_COLOR
|
||||
|
||||
#include <stdint.h> // for uint8_t
|
||||
#include <string> // for wstring
|
||||
#include <string> // for wstring
|
||||
|
||||
#ifdef RGB
|
||||
// Workaround for wingdi.h (via Windows.h) defining macros that break things.
|
||||
@@ -322,6 +322,14 @@ class Color {
|
||||
uint8_t blue_ = 0;
|
||||
};
|
||||
|
||||
inline namespace literals {
|
||||
|
||||
/// @brief Creates a color from a combined hex RGB representation,
|
||||
/// e.g. 0x808000_rgb
|
||||
Color operator""_rgb(unsigned long long int combined);
|
||||
|
||||
} // namespace literals
|
||||
|
||||
} // namespace ftxui
|
||||
|
||||
#endif /* end of include guard: FTXUI_COLOR_H_ */
|
||||
|
Reference in New Issue
Block a user