ColorScheme
#include <colorscheme.h>
Public Member Functions | |
ColorScheme () | |
QColor | colorAt (int i) const |
QColor | colorNamed (const QString &name) const |
QString | fileName () const |
bool | hasColorNamed (const QString &name) const |
QString | keyAt (int i) const |
bool | load (const QString &filename) |
void | loadFromConfig () |
QString | nameAt (int i) const |
QString | nameFromKey (const QString &key) const |
unsigned int | numberOfColors () const |
bool | save (const QString &name) |
void | saveToConfig () |
void | setColor (const QString &key, const QString &color) |
void | setDarkPalette (bool enable) |
void | setStarColorIntensity (int intens) |
void | setStarColorMode (int mode) |
void | setStarColorModeIntensity (int mode, int intens) |
int | starColorIntensity () const |
int | starColorMode () const |
bool | useDarkPalette () const |
Detailed Description
This class stores all of the adjustable colors in KStars, in a QMap object keyed by the names of the colors.
It also stores information on how stars are to be rendered in the map (with realistic colors, or as solid red/whit/black circles). In addition to the brief "Key names" used to index the colors in the QMap, each color has a "long name" description that is a bit more verbose, and suitable for UI display.
- Version
- 1.0
Definition at line 26 of file colorscheme.h.
Constructor & Destructor Documentation
◆ ColorScheme()
ColorScheme::ColorScheme | ( | ) |
Constructor.
Enter all adjustable colors and their default values into the QMap. Also assign the corresponding long names.
Definition at line 20 of file colorscheme.cpp.
Member Function Documentation
◆ colorAt()
QColor ColorScheme::colorAt | ( | int | i | ) | const |
i
the index of the color to retrieve
- Returns
- a color by its index in the QMap
Definition at line 100 of file colorscheme.cpp.
◆ colorNamed()
Retrieve a color by name.
name
the key name of the color to be retrieved.
- Returns
- the requested color, or Qt::white if color name not found.
Definition at line 89 of file colorscheme.cpp.
◆ fileName()
|
inline |
- Returns
- the Filename associated with the color scheme.
Definition at line 91 of file colorscheme.h.
◆ hasColorNamed()
|
inline |
- Returns
- true if the Palette contains the given key name
Definition at line 36 of file colorscheme.h.
◆ keyAt()
QString ColorScheme::keyAt | ( | int | i | ) | const |
i
the index of the key name to retrieve
- Returns
- the key name of the color at index i
Definition at line 110 of file colorscheme.cpp.
◆ load()
bool ColorScheme::load | ( | const QString & | filename | ) |
Load a color scheme from a *.colors file filename
the filename of the color scheme to be loaded.
- Returns
- true if the scheme was successfully loaded
Definition at line 129 of file colorscheme.cpp.
◆ loadFromConfig()
void ColorScheme::loadFromConfig | ( | ) |
Read color-scheme data from the Config object.
Definition at line 327 of file colorscheme.cpp.
◆ nameAt()
QString ColorScheme::nameAt | ( | int | i | ) | const |
i
the index of the long name to retrieve
- Returns
- the name of the color at index i
Definition at line 105 of file colorscheme.cpp.
◆ nameFromKey()
- Returns
- the long name of the color whose key name is given
key
the key name identifying the color.
Definition at line 115 of file colorscheme.cpp.
◆ numberOfColors()
|
inline |
- Returns
- the number of colors in the color scheme.
Definition at line 100 of file colorscheme.h.
◆ save()
bool ColorScheme::save | ( | const QString & | name | ) |
Save the current color scheme to a *.colors file.
name
the filename to create
- Returns
- true if the color scheme is successfully writen to a file
Definition at line 251 of file colorscheme.cpp.
◆ saveToConfig()
void ColorScheme::saveToConfig | ( | ) |
Save color-scheme data to the Config object.
Definition at line 340 of file colorscheme.cpp.
◆ setColor()
Change the color with the given key to the given value key
the key-name of the color to be changed color
the new color value.
Definition at line 120 of file colorscheme.cpp.
◆ setDarkPalette()
void ColorScheme::setDarkPalette | ( | bool | enable | ) |
setDarkPalette Set whether the color schemes uses dark palette
- Parameters
-
enable True to use dark palette. False to use application default palette
◆ setStarColorIntensity()
void ColorScheme::setStarColorIntensity | ( | int | intens | ) |
Set the star color intensity value used by the color scheme intens
The star color intensity value.
Definition at line 375 of file colorscheme.cpp.
◆ setStarColorMode()
void ColorScheme::setStarColorMode | ( | int | mode | ) |
Set the star color mode used by the color scheme mode
the star color mode to use.
Definition at line 355 of file colorscheme.cpp.
◆ setStarColorModeIntensity()
void ColorScheme::setStarColorModeIntensity | ( | int | mode, |
int | intens ) |
Set the star color mode and intensity value used by the color scheme mode
the star color mode to use intens
The star color intensity value.
Definition at line 384 of file colorscheme.cpp.
◆ starColorIntensity()
|
inline |
- Returns
- the star color intensity value used by the color scheme
Definition at line 109 of file colorscheme.h.
◆ starColorMode()
|
inline |
- Returns
- the star color mode used by the color scheme
Definition at line 103 of file colorscheme.h.
◆ useDarkPalette()
|
inline |
- Returns
- True if dark palette colors are used by the color scheme
Definition at line 106 of file colorscheme.h.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:38:44 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.