GNU Octave  6.2.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
CharacterColor Class Reference

Describes the color of a single character in the terminal. More...

#include "CharacterColor.h"

Collaboration diagram for CharacterColor:

Public Member Functions

 CharacterColor ()
 Constructs a new CharacterColor whoose color and color space are undefined. More...
 
 CharacterColor (quint8 colorSpace, int co)
 Constructs a new CharacterColor using the specified colorSpace and with color value co. More...
 
QColor color (const ColorEntry *palette) const
 Returns the color within the specified color @palette. More...
 
bool isValid ()
 Returns true if this character color entry is valid. More...
 
void toggleIntensive ()
 Toggles the value of this color between a normal system color and the corresponding intensive system color. More...
 

Private Attributes

quint8 _colorSpace
 
quint8 _u
 
quint8 _v
 
quint8 _w
 

Friends

class Character
 
bool operator!= (const CharacterColor &a, const CharacterColor &b)
 Compares two colors and returns true if they represent different color values or use different color spaces. More...
 
bool operator== (const CharacterColor &a, const CharacterColor &b)
 Compares two colors and returns true if they represent the same color value and use the same color space. More...
 

Detailed Description

Describes the color of a single character in the terminal.

Definition at line 143 of file CharacterColor.h.

Constructor & Destructor Documentation

◆ CharacterColor() [1/2]

CharacterColor::CharacterColor ( )
inline

Constructs a new CharacterColor whoose color and color space are undefined.

Definition at line 149 of file CharacterColor.h.

◆ CharacterColor() [2/2]

CharacterColor::CharacterColor ( quint8  colorSpace,
int  co 
)
inline

Constructs a new CharacterColor using the specified colorSpace and with color value co.

The meaning of co depends on the colorSpace used.

TODO : Document how co relates to colorSpace

TODO : Add documentation about available color spaces.

Definition at line 166 of file CharacterColor.h.

References _colorSpace, _u, _v, _w, COLOR_SPACE_256, COLOR_SPACE_DEFAULT, COLOR_SPACE_RGB, COLOR_SPACE_SYSTEM, and COLOR_SPACE_UNDEFINED.

Member Function Documentation

◆ color()

QColor CharacterColor::color ( const ColorEntry palette) const
inline

Returns the color within the specified color @palette.

The palette is only used if this color is one of the 16 system colors, otherwise it is ignored.

Definition at line 267 of file CharacterColor.h.

References _colorSpace, _u, _v, _w, BASE_COLORS, color256(), COLOR_SPACE_256, COLOR_SPACE_DEFAULT, COLOR_SPACE_RGB, COLOR_SPACE_SYSTEM, and COLOR_SPACE_UNDEFINED.

Referenced by HTMLDecoder::decodeLine(), TerminalView::drawCharacters(), TerminalView::drawTextFragment(), and TerminalView::paintFilters().

◆ isValid()

bool CharacterColor::isValid ( )
inline

Returns true if this character color entry is valid.

Definition at line 197 of file CharacterColor.h.

References _colorSpace, and COLOR_SPACE_UNDEFINED.

Referenced by Screen::setBackColor(), and Screen::setForeColor().

◆ toggleIntensive()

void CharacterColor::toggleIntensive ( )
inline

Toggles the value of this color between a normal system color and the corresponding intensive system color.

This is only applicable if the color is using the COLOR_SPACE_DEFAULT or COLOR_SPACE_SYSTEM color spaces.

Definition at line 283 of file CharacterColor.h.

References _colorSpace, _v, COLOR_SPACE_DEFAULT, and COLOR_SPACE_SYSTEM.

Referenced by Screen::effectiveRendition().

Friends And Related Function Documentation

◆ Character

friend class Character
friend

Definition at line 145 of file CharacterColor.h.

◆ operator!=

bool operator!= ( const CharacterColor a,
const CharacterColor b 
)
friend

Compares two colors and returns true if they represent different color values or use different color spaces.

Definition at line 247 of file CharacterColor.h.

◆ operator==

bool operator== ( const CharacterColor a,
const CharacterColor b 
)
friend

Compares two colors and returns true if they represent the same color value and use the same color space.

Definition at line 239 of file CharacterColor.h.

Member Data Documentation

◆ _colorSpace

quint8 CharacterColor::_colorSpace
private

◆ _u

quint8 CharacterColor::_u
private

◆ _v

quint8 CharacterColor::_v
private

◆ _w

quint8 CharacterColor::_w
private

Definition at line 236 of file CharacterColor.h.

Referenced by CharacterColor(), and color().


The documentation for this class was generated from the following file: