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 241 return a._colorSpace ==
b._colorSpace &&
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);
291 #endif // CHARACTERCOLOR_H 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...
An entry in a terminal display's color palette.
bool isValid()
Returns true if this character color entry is valid.
bool operator==(const CharacterColor &a, const CharacterColor &b)
static const ColorEntry base_color_table[(2 *(2+8))]
A single character in the terminal which consists of a unicode character value, foreground and backgr...
#define COLOR_SPACE_DEFAULT
Describes the color of a single character in the terminal.
CharacterColor(quint8 colorSpace, int co)
Constructs a new CharacterColor using the specified colorSpace and with color value co...
QColor color
The color value of this entry for display.
nd example oindent opens the file binary numeric values will be read assuming they are stored in IEEE format with the least significant bit and then converted to the native representation Opening a file that is already open simply opens it again and returns a separate file id It is not an error to open a file several though writing to the same file through several different file ids may produce unexpected results The possible values of text mode reading and writing automatically converts linefeeds to the appropriate line end character for the you may append a you must also open the file in binary mode The parameter conversions are currently only supported for and permissions will be set to and then everything is written in a single operation This is very efficient and improves performance c
ColorEntry()
Constructs a new color palette entry with an undefined color, and with the transparent and bold flags...
calling an anonymous function involves an overhead quite comparable to the overhead of an m file function Passing a handle to a built in function is because the interpreter is not involved in the internal loop For a
bool transparent
If true character backgrounds using this color should be transparent.
void operator=(const ColorEntry &rhs)
Sets the color, transparency and boldness of this color to those of rhs.
ColorEntry(QColor c, bool tr, bool b)
Constructs a new color palette entry.
CharacterColor()
Constructs a new CharacterColor whoose color and color space are undefined.
QColor color(const ColorEntry *palette) const
Returns the color within the specified color .
bool bold
If true characters drawn using this color should be bold.
#define COLOR_SPACE_UNDEFINED
void toggleIntensive()
Toggles the value of this color between a normal system color and the corresponding intensive system ...
const QColor color256(quint8 u, const ColorEntry *base)
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 ...
#define COLOR_SPACE_SYSTEM
bool operator!=(const CharacterColor &a, const CharacterColor &b)