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

Konsole

  • Konsole
  • ColorScheme
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
Konsole::ColorScheme Class Reference

#include <ColorScheme.h>

Public Member Functions

 ColorScheme ()
 
 ColorScheme (const ColorScheme &other)
 
 ~ColorScheme ()
 
QColor backgroundColor () const
 
ColorEntry colorEntry (int index, uint randomSeed=0) const
 
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 (const 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 setWallpaper (const QString &path)
 
ColorSchemeWallpaper::Ptr wallpaper () const
 
void write (KConfig &config) const
 

Static Public Member Functions

static QString colorNameForIndex (int index)
 
static QString translatedColorNameForIndex (int index)
 

Static Public Attributes

static const ColorEntry defaultTable []
 

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 72 of file ColorScheme.h.

Constructor & Destructor Documentation

ColorScheme::ColorScheme ( )

Constructs a new color scheme which is initialized to the default color set for Konsole.

Definition at line 127 of file ColorScheme.cpp.

ColorScheme::ColorScheme ( const ColorScheme &  other)

Definition at line 135 of file ColorScheme.cpp.

ColorScheme::~ColorScheme ( )

Definition at line 156 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 270 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 193 of file ColorScheme.cpp.

QString ColorScheme::colorNameForIndex ( int  index)
static

Definition at line 113 of file ColorScheme.cpp.

QString ColorScheme::description ( ) const

Returns the descriptive name of the color scheme.

Definition at line 166 of file ColorScheme.cpp.

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 266 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
tableArray into which the color entries for this color scheme are copied.
randomSeedColor schemes may allow certain colors in their palette to be randomized. The seed is used to pick the random color.

Definition at line 222 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 274 of file ColorScheme.cpp.

QString ColorScheme::name ( ) const

Returns the name of the color scheme.

Definition at line 175 of file ColorScheme.cpp.

qreal ColorScheme::opacity ( ) const

Returns the opacity level for this color scheme, see setOpacity() TODO: More documentation.

Definition at line 284 of file ColorScheme.cpp.

bool ColorScheme::randomizedBackgroundColor ( ) const

Returns true if the background color is randomized.

Definition at line 227 of file ColorScheme.cpp.

void ColorScheme::read ( const KConfig &  config)

Reads the color scheme from the specified configuration source.

Definition at line 289 of file ColorScheme.cpp.

void ColorScheme::setColorTableEntry ( int  index,
const ColorEntry &  entry 
)

Sets a single entry within the color palette.

Definition at line 180 of file ColorScheme.cpp.

void ColorScheme::setDescription ( const QString &  description)

Sets the descriptive name of the color scheme.

Definition at line 162 of file ColorScheme.cpp.

void ColorScheme::setName ( const QString &  name)

Sets the name of the color scheme.

Definition at line 171 of file ColorScheme.cpp.

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 280 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 231 of file ColorScheme.cpp.

void ColorScheme::setWallpaper ( const QString &  path)

Definition at line 365 of file ColorScheme.cpp.

QString ColorScheme::translatedColorNameForIndex ( int  index)
static

Definition at line 120 of file ColorScheme.cpp.

ColorSchemeWallpaper::Ptr ColorScheme::wallpaper ( ) const

Definition at line 370 of file ColorScheme.cpp.

void ColorScheme::write ( KConfig &  config) const

Writes the color scheme to the specified configuration source.

Definition at line 322 of file ColorScheme.cpp.

Member Data Documentation

const ColorEntry ColorScheme::defaultTable
static
Initial value:
= {
ColorEntry(QColor(0x00, 0x00, 0x00)),
ColorEntry(QColor(0xFF, 0xFF, 0xFF)),
ColorEntry(QColor(0x00, 0x00, 0x00)),
ColorEntry(QColor(0xB2, 0x18, 0x18)),
ColorEntry(QColor(0x18, 0xB2, 0x18)),
ColorEntry(QColor(0xB2, 0x68, 0x18)),
ColorEntry(QColor(0x18, 0x18, 0xB2)),
ColorEntry(QColor(0xB2, 0x18, 0xB2)),
ColorEntry(QColor(0x18, 0xB2, 0xB2)),
ColorEntry(QColor(0xB2, 0xB2, 0xB2)),
ColorEntry(QColor(0x00, 0x00, 0x00)),
ColorEntry(QColor(0xFF, 0xFF, 0xFF)),
ColorEntry(QColor(0x68, 0x68, 0x68)),
ColorEntry(QColor(0xFF, 0x54, 0x54)),
ColorEntry(QColor(0x54, 0xFF, 0x54)),
ColorEntry(QColor(0xFF, 0xFF, 0x54)),
ColorEntry(QColor(0x54, 0x54, 0xFF)),
ColorEntry(QColor(0xFF, 0x54, 0xFF)),
ColorEntry(QColor(0x54, 0xFF, 0xFF)),
ColorEntry(QColor(0xFF, 0xFF, 0xFF))
}

Definition at line 171 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-2020 The KDE developers.
Generated on Sat May 9 2020 03:56:27 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Konsole

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

applications API Reference

Skip menu "applications API Reference"
  •   kate
  •       kate
  •   KTextEditor
  •   Kate
  • Konsole

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