48 BLACK = 0, BLUE, RED, MAGENTA, GREEN, CYAN, YELLOW,
WHITE,
89 operator ColorModVal(
void)
const noexcept {
return(val_); }
106 operator ColorModVal(
void)
const noexcept {
return(val_); }
123 operator ColorModVal(
void)
const noexcept {
return(val_); }
140 operator ColorModVal(
void)
const noexcept {
return(val_); }
175 void setNext(
bool circular =
true);
227 bool bright(
void)
const noexcept {
return(brightc_); }
271 operator ColorBaseType(
void)
const noexcept {
return(color_); }
451 Colors & operator<<(Ink i)
noexcept {
setInk(i);
return(*
this); }
452 Colors & operator<<(Bright b)
noexcept {
setBright(b);
return(*
this); }
453 Colors & operator<<(Flash f)
noexcept {
setFlash(f);
return(*
this); }
455 Colors & operator<<(Over o)
noexcept {
setOver(o);
return(*
this); }
459 (inv_ ==
ON ?
"ON" :
"OFF") +
", over " +
460 (ov_ ==
ON ?
"ON" :
"OFF")); }
uint32_t Size
Size of a palette.
Size Index
Index of a color in a palette.
A RGB color with 8 bits per component.
A palette defining a number of RGB colors.
PrintColor(ColorBaseType cbt=BLACK)
Default constructor and from a constant color. Call base constructor.
Colors(AttrColors cc, Inverse inv, Over ov)
Constructor from an attribute specification plus inverse and over.
BasicColor basic(void) const
Conversion to BasicColor, if a valid one; otherwise, exception.
static constexpr RGBPalette::Size NUMLINEARCOLORS
Number of linear colors. Black is counted twice, being equal w & w/o br.
ColorModVal bright(void) const noexcept
Get the bright element.
std::string to_string(bool shorttxt=false) const
Return a descriptive text of this color specification.
ColorModVal inverse(void) const noexcept
Get the inverse mode.
std::string to_string(void) const
Return a text with the information of the colors.
std::string to_string(void) const
Return the name for this color.
BasicColor(ColorBaseType cbt=BLACK)
Default constructor from a given base color.
void setPaper(PrintColor p) noexcept
Change the paper element.
AttrColors(void)
Default constructor: no bright, no flash, black ink, white paper.
bool isBasic(void) const noexcept
Return TRUE if the color is a basic one and not CONTRAST or TRANSP.
BrightColor(RGBPalette::Index li)
Constructor from a linear index, from 0 to NUMLINEARCOLORS-1.
BrightColor(BasicColor bc=BLACK, bool br=false)
Default constructor and constructor from BasicColor.
void setInverse(ColorModVal inv) noexcept
Change the inverse mode.
bool bright(void) const noexcept
Get the bright level.
AttrColors(Flash f, Bright b, Paper p, Ink i)
Constructor from elements.
AttrColors swapped(void) const noexcept
< Return a version of these colors but with ink and paper swapped.
void swapPaperAndInk(void) noexcept
Swap paper and ink.
RGBPalette::Index linear(void) const noexcept
Return the index of this color in the ZX palette.
void adjustByExisting(const AttrColors &ex)
Change this attrs as though the ZX would use them for printing on EX.
PrintColor paper(void) const noexcept
Get the paper element.
const RGBColor & rgbColor(void) const noexcept
Return the RGBColor used to define this BrightColor.
void setFlash(ColorModVal f) noexcept
Change the flash element.
void setOver(bool o=true) noexcept
Change the over element to one of ON or OFF.
BrightColor(const RGBColor &col)
Constructor from a rgb color.
void setInverse(bool i=true) noexcept
< Change the inverse element to one of ON or OFF.
Colors(void)
Default constructor: default color attribute plus no inverse or over.
static constexpr RGBPalette::Index FIRSTLINEARCOLORWBRIGHT
First linear color that has bright.
PrintColor(const BasicColor &bc) noexcept
Constructor from the corresponding BasicColor.
std::string to_string(void) const
Return a descriptive text of the color.
BasicColor color(void) const noexcept
Get the basic color.
void setBright(ColorModVal b) noexcept
Change the bright element.
ColorModVal flash(void) const noexcept
Get the flash element.
void setOver(ColorModVal ov) noexcept
Change the over mode.
PrintColor ink(void) const noexcept
Get the ink element.
std::string to_string(void) const
Return a descriptive string for this color.
void setNext(bool circular=true)
Set this color to the next basic color.
void setBright(bool b=true) noexcept
< Change the bright element to one of ON or OFF.
void setInk(PrintColor i) noexcept
Change the ink element.
ColorModVal over(void) const noexcept
Get the over mode.
bool rgb(RGBColor &ink, RGBColor &paper) const
Get RGB colors for this attribute and return flash.
uint8_t toAttr(void) const
Convert the color specification into a byte for the attribute screen.
void setFlash(bool f=true) noexcept
< Change the flash element to one of ON or OFF.
BasicColor contrasting(void) const noexcept
Return the basic color that contrasts with this one.
AttrColors(uint8_t attr)
Constructor from the byte that contains the screen attribute.
Complete color specification for an attr (character) cell on the zx screen.
One of the 8 basic colors of the ZX, not considering bright or flash.
A value of bright that is different to the same value of flash, inv or over.
A basic color plus a bright level (on / off).
Color specification for a character cell, plus modes of printing.
A value of flash that is different to the same value of bright, inv or over.
A printcolor for ink as a different type from a color for paper.
A value of inv that is different to the same value of flash, bright or over.
A value of over that is different to the same value of flash, bright or inv.
A printcolor for paper as a different type from a color for ink.
A BasicColor or CONTRAST or TRANSPARENT, but not with bright or flash.
ColorBaseType
Main color constants.
@ ON
Basic states. Must be 0 and 1, respectively.
@ TRANSP
To respect existing attribute in screen.
@ NUMBASICCOLORS
Number of basic colors.
The main namespace of the library, that spans across all the zx modules.
ColorModVal
Values of bright, flash, inverse and over.
const RGBPalette kZXPalette
The original palette of the ZX.