• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

kstars

Public Member Functions | List of all members
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 setStarColorIntensity (int intens)
 
void setStarColorMode (int mode)
 
void setStarColorModeIntensity (int mode, int intens)
 
int starColorIntensity () const
 
int starColorMode () 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 38 of file colorscheme.h.

Constructor & Destructor Documentation

ColorScheme::ColorScheme ( )

Constructor.

Enter all adjustable colors and their default values into the QMap. Also assign the corresponding long names.

Definition at line 35 of file colorscheme.cpp.

Member Function Documentation

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

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

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

Definition at line 93 of file colorscheme.h.

bool ColorScheme::hasColorNamed ( const QString &  name) const
inline
Returns
true if the Palette contains the given key name

Definition at line 46 of file colorscheme.h.

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

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

void ColorScheme::loadFromConfig ( )

Read color-scheme data from the Config object.

Definition at line 266 of file colorscheme.cpp.

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

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

unsigned int ColorScheme::numberOfColors ( ) const
inline
Returns
the number of colors in the color scheme.

Definition at line 102 of file colorscheme.h.

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 writeen to a file

Definition at line 218 of file colorscheme.cpp.

void ColorScheme::saveToConfig ( )

Save color-scheme data to the Config object.

Definition at line 277 of file colorscheme.cpp.

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

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

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

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

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

Definition at line 108 of file colorscheme.h.

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

Definition at line 105 of file colorscheme.h.


The documentation for this class was generated from the following files:
  • colorscheme.h
  • colorscheme.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:36:22 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kstars

Skip menu "kstars"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal