Konsole
Konsole::ColorScheme Class Reference
#include <ColorScheme.h>

Detailed Description
Represents a color scheme for a terminal display.The color scheme includes the palette of colors used to draw the text and character backgrounds in the display and the opacity level of the display background.
Definition at line 47 of file ColorScheme.h.
Public Member Functions | |
QColor | backgroundColor () const |
ColorEntry | colorEntry (int index, uint randomSeed=0) const |
ColorScheme (const ColorScheme &other) | |
ColorScheme () | |
QString | description () const |
QColor | foregroundColor () const |
void | getColorTable (ColorEntry *table, uint randomSeed=0) const |
bool | hasDarkBackground () const |
QString | name () const |
qreal | opacity () const |
bool | randomizedBackgroundColor () const |
void | read (KConfig &config) |
void | setColorTableEntry (int index, const ColorEntry &entry) |
void | setDescription (const QString &description) |
void | setName (const QString &name) |
void | setOpacity (qreal opacity) |
void | setRandomizedBackgroundColor (bool randomize) |
void | write (KConfig &config) const |
~ColorScheme () | |
Static Public Member Functions | |
static QString | colorNameForIndex (int index) |
static QString | translatedColorNameForIndex (int index) |
Constructor & Destructor Documentation
ColorScheme::ColorScheme | ( | ) |
Constructs a new color scheme which is initialised to the default color set for Konsole.
Definition at line 115 of file ColorScheme.cpp.
ColorScheme::ColorScheme | ( | const ColorScheme & | other | ) |
Definition at line 121 of file ColorScheme.cpp.
ColorScheme::~ColorScheme | ( | ) |
Definition at line 144 of file ColorScheme.cpp.
Member Function Documentation
QColor ColorScheme::backgroundColor | ( | ) | const |
Convenience method.
Returns the background color for this scheme, this is the primary color used to draw the terminal background in this scheme.
Definition at line 252 of file ColorScheme.cpp.
ColorEntry ColorScheme::colorEntry | ( | int | index, | |
uint | randomSeed = 0 | |||
) | const |
Retrieves a single color entry from the table.
See getColorTable()
Definition at line 170 of file ColorScheme.cpp.
QString ColorScheme::colorNameForIndex | ( | int | index | ) | [static] |
Definition at line 293 of file ColorScheme.cpp.
QString ColorScheme::description | ( | ) | const |
QColor ColorScheme::foregroundColor | ( | ) | const |
Convenience method.
Returns the foreground color for this scheme, this is the primary color used to draw the text in this scheme.
Definition at line 248 of file ColorScheme.cpp.
void ColorScheme::getColorTable | ( | ColorEntry * | table, | |
uint | randomSeed = 0 | |||
) | const |
Copies the color entries which form the palette for this color scheme into table
.
table
should be an array with TABLE_COLORS entries.
- Parameters:
-
table Array into which the color entries for this color scheme are copied. randomSeed Color schemes may allow certain colors in their palette to be randomized. The seed is used to pick the random color.
Definition at line 201 of file ColorScheme.cpp.
bool ColorScheme::hasDarkBackground | ( | ) | const |
Returns true if this color scheme has a dark background.
The background color is said to be dark if it has a value of less than 127 in the HSV color space.
Definition at line 256 of file ColorScheme.cpp.
QString ColorScheme::name | ( | ) | const |
qreal ColorScheme::opacity | ( | ) | const |
Returns the opacity level for this color scheme, see setOpacity() TODO: More documentation.
Definition at line 263 of file ColorScheme.cpp.
bool ColorScheme::randomizedBackgroundColor | ( | ) | const |
void ColorScheme::read | ( | KConfig & | config | ) |
Reads the color scheme from the specified configuration source.
Definition at line 265 of file ColorScheme.cpp.
void ColorScheme::setColorTableEntry | ( | int | index, | |
const ColorEntry & | entry | |||
) |
void ColorScheme::setDescription | ( | const QString & | description | ) |
void ColorScheme::setName | ( | const QString & | name | ) |
void ColorScheme::setOpacity | ( | qreal | opacity | ) |
Sets the opacity level of the display background.
opacity
ranges between 0 (completely transparent background) and 1 (completely opaque background).
Defaults to 1.
TODO: More documentation
Definition at line 262 of file ColorScheme.cpp.
void ColorScheme::setRandomizedBackgroundColor | ( | bool | randomize | ) |
Enables randomization of the background color.
This will cause the palette returned by getColorTable() and colorEntry() to be adjusted depending on the value of the random seed argument to them.
Definition at line 210 of file ColorScheme.cpp.
QString ColorScheme::translatedColorNameForIndex | ( | int | index | ) | [static] |
Definition at line 299 of file ColorScheme.cpp.
void ColorScheme::write | ( | KConfig & | config | ) | const |
Writes the color scheme to the specified configuration source.
Definition at line 279 of file ColorScheme.cpp.
The documentation for this class was generated from the following files: