25 #ifndef CHARACTERCOLOR_H
26 #define CHARACTERCOLOR_H
92 #define BASE_COLORS (2+8)
94 #define TABLE_COLORS (INTENSITIES*BASE_COLORS)
96 #define DEFAULT_FORE_COLOR 0
97 #define DEFAULT_BACK_COLOR 1
105 ColorEntry(QColor(0x00,0x00,0x00), 1, 0 ),
ColorEntry( QColor(0xFF,0xFF,0xFF), 0, 0 ),
106 ColorEntry(QColor(0x00,0x00,0x00), 0, 0 ),
ColorEntry( QColor(0xB2,0x18,0x18), 0, 0 ),
107 ColorEntry(QColor(0x18,0xB2,0x18), 0, 0 ),
ColorEntry( QColor(0xB2,0x68,0x18), 0, 0 ),
108 ColorEntry(QColor(0x18,0x18,0xB2), 0, 0 ),
ColorEntry( QColor(0xB2,0x18,0xB2), 0, 0 ),
109 ColorEntry(QColor(0x18,0xB2,0xB2), 0, 0 ),
ColorEntry( QColor(0xB2,0xB2,0xB2), 0, 0 ),
111 ColorEntry(QColor(0x00,0x00,0x00), 0, 1 ),
ColorEntry( QColor(0xFF,0xFF,0xFF), 1, 0 ),
112 ColorEntry(QColor(0x68,0x68,0x68), 0, 0 ),
ColorEntry( QColor(0xFF,0x54,0x54), 0, 0 ),
113 ColorEntry(QColor(0x54,0xFF,0x54), 0, 0 ),
ColorEntry( QColor(0xFF,0xFF,0x54), 0, 0 ),
114 ColorEntry(QColor(0x54,0x54,0xFF), 0, 0 ),
ColorEntry( QColor(0xFF,0x54,0xFF), 0, 0 ),
134 #define COLOR_SPACE_UNDEFINED 0
135 #define COLOR_SPACE_DEFAULT 1
136 #define COLOR_SPACE_SYSTEM 2
137 #define COLOR_SPACE_256 3
138 #define COLOR_SPACE_RGB 4
255 if (u < 8)
return base[u+2 ].
color; u -= 8;
259 if (u < 216)
return QColor(255*((u/36)%6)/5,
261 255*((u/ 1)%6)/5); u -= 216;
264 int gray = u*10+8;
return QColor(gray,gray,gray);
#define COLOR_SPACE_SYSTEM
const QColor color256(quint8 u, const ColorEntry *base)
bool operator==(const CharacterColor &a, const CharacterColor &b)
#define COLOR_SPACE_DEFAULT
#define COLOR_SPACE_UNDEFINED
bool operator!=(const CharacterColor &a, const CharacterColor &b)
static const ColorEntry base_color_table[(2 *(2+8))]
Describes the color of a single character in the terminal.
QColor color(const ColorEntry *palette) const
Returns the color within the specified color @palette.
friend bool operator==(const CharacterColor &a, const CharacterColor &b)
Compares two colors and returns true if they represent the same color value and use the same color sp...
void toggleIntensive()
Toggles the value of this color between a normal system color and the corresponding intensive system ...
bool isValid()
Returns true if this character color entry is valid.
CharacterColor(quint8 colorSpace, int co)
Constructs a new CharacterColor using the specified colorSpace and with color value co.
CharacterColor()
Constructs a new CharacterColor whoose color and color space are undefined.
friend bool operator!=(const CharacterColor &a, const CharacterColor &b)
Compares two colors and returns true if they represent different color values or use different color ...
A single character in the terminal which consists of a unicode character value, foreground and backgr...
An entry in a terminal display's color palette.
bool bold
If true characters drawn using this color should be bold.
ColorEntry(QColor c, bool tr, bool b)
Constructs a new color palette entry.
ColorEntry()
Constructs a new color palette entry with an undefined color, and with the transparent and bold flags...
void operator=(const ColorEntry &rhs)
Sets the color, transparency and boldness of this color to those of rhs.
bool transparent
If true character backgrounds using this color should be transparent.
QColor color
The color value of this entry for display.