ColorScheme

Search for usage in LXR

ColorScheme Class Reference

#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.

Author
Jason Harris
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 98 of file colorscheme.cpp.

◆ colorNamed()

QColor ColorScheme::colorNamed ( const QString & name) const

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 87 of file colorscheme.cpp.

◆ fileName()

QString ColorScheme::fileName ( ) const
inline
Returns
the Filename associated with the color scheme.

Definition at line 91 of file colorscheme.h.

◆ hasColorNamed()

bool ColorScheme::hasColorNamed ( const QString & name) const
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 108 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 127 of file colorscheme.cpp.

◆ loadFromConfig()

void ColorScheme::loadFromConfig ( )

Read color-scheme data from the Config object.

Definition at line 325 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 103 of file colorscheme.cpp.

◆ nameFromKey()

QString ColorScheme::nameFromKey ( const QString & key) const
Returns
the long name of the color whose key name is given key the key name identifying the color.

Definition at line 113 of file colorscheme.cpp.

◆ numberOfColors()

unsigned int ColorScheme::numberOfColors ( ) const
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 249 of file colorscheme.cpp.

◆ saveToConfig()

void ColorScheme::saveToConfig ( )

Save color-scheme data to the Config object.

Definition at line 338 of file colorscheme.cpp.

◆ setColor()

void ColorScheme::setColor ( const QString & key,
const QString & color )

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 118 of file colorscheme.cpp.

◆ setDarkPalette()

void ColorScheme::setDarkPalette ( bool enable)

setDarkPalette Set whether the color schemes uses dark palette

Parameters
enableTrue 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 373 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 353 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 382 of file colorscheme.cpp.

◆ starColorIntensity()

int ColorScheme::starColorIntensity ( ) const
inline
Returns
the star color intensity value used by the color scheme

Definition at line 109 of file colorscheme.h.

◆ starColorMode()

int ColorScheme::starColorMode ( ) const
inline
Returns
the star color mode used by the color scheme

Definition at line 103 of file colorscheme.h.

◆ useDarkPalette()

bool ColorScheme::useDarkPalette ( ) const
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:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sun Feb 25 2024 18:45:36 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.