class KColorScheme |
|
|
A set of methods used to work with colors. KColorScheme currently provides access to the system color palette that the user has selected (in the future, it is expected to do more). As of KDE4, this class is the correct way to look up colors from the system palette, as opposed to KGlobalSettings (such usage is deprecated). It greatly expands on KGlobalSettings and QPalette by providing five distinct "sets" with several color choices each, covering background, foreground, and decoration colors. A KColorScheme instance represents colors corresponding to a "set", where a set consists of those colors used to draw a particular type of element, such as a menu, button, view, selected text, or tooltip. Each set has a distinct set of colors, so you should always use the correct set for drawing and never assume that a particular foreground for one set is the same as the foreground for any other set. Individual colors may be quickly referenced by creating an anonymous instance and invoking a lookup member. See also KColorScheme.ColorSet, KColorScheme.ForegroundRole, KColorScheme.BackgroundRole, KColorScheme.DecorationRole, KColorScheme.ShadeRole |
|
|
Construct a palette from given color set, using the colors from the given KConfig (if null, the system colors are used). Deprecated Use the other constructor that takes a state. In KDE4 it will not be safe to assume that the palette for different states (Active, Inactive, Disabled as of Qt 4.3) are identical. Therefore users really should specify a state. This constructor will most likely be removed before 4.0 final. |
|
Construct a palette from given color set and state, using the colors from the given KConfig (if null, the system colors are used). |
|
Retrieve the requested background brush. |
|
Retrieve the requested decoration brush. |
|
Retrieve the requested foreground brush. |
|
Retrieve the requested shade color, using KColorScheme.background(KColorScheme.NormalBackground) as the base color and the contrast setting from the KConfig used to create this KColorScheme instance (the system contrast setting, if no KConfig was specified). Shades are chosen such that all shades would contrast with the base color. This means that if base is very dark, the 'dark' shades will be lighter than the base color, with midlight() == shadow(). Conversely, if the base color is very light, the 'light' shades will be darker than the base color, with light() == mid(). |
|
Retrieve the requested shade color, using the specified color as the base color and the system contrast setting. Shades are chosen such that all shades would contrast with the base color. This means that if base is very dark, the 'dark' shades will be lighter than the base color, with midlight() == shadow(). Conversely, if the base color is very light, the 'light' shades will be darker than the base color, with light() == mid(). |
|
Retrieve the requested shade color, using the specified color as the base color and the specified contrast.
contrast - Amount roughly specifying the contrast by which to adjust the base color, between -1.0 and 1.0 (values between 0.0 and 1.0 correspond to the value from KGlobalSettings.contrastF) chromaAdjust - (optional) Amount by which to adjust the chroma of the shade (1.0 means no adjustment) Shades are chosen such that all shades would contrast with the base color. This means that if base is very dark, the 'dark' shades will be lighter than the base color, with midlight() == shadow(). Conversely, if the base color is very light, the 'light' shades will be darker than the base color, with light() == mid(). See also KColorUtils.shade |
NormalBackground | - | Normal background. | |
AlternateBackground | - | Alternate background, e.g. for use in lists. May be the same as BackgroundNormal, especially in sets other than View and Window. | |
ActiveBackground | - | Third color, e.g. items which are new, active, requesting attention, etc. Alerting the user that a certain field must be filled out would be a good usage. (Unlike ActiveText, this should not be used for mouseover effects.) | |
LinkBackground | - | Fourth color, e.g. (unvisited) links or other clickable items. | |
VisitedBackground | - | Fifth color, e.g. (visited) links. | |
NegativeBackground | - | Sixth color, e.g. errors, untrusted content, etc. | |
NeutralBackground | - | Seventh color, e.g. warnings, secure/encrypted content. | |
PositiveBackground | - | Eigth color, e.g. success messages, trusted content. |
View | - | Views; e.g. frames, input fields, etc. /p> p> If it contains things that can be selected, it is probably a View. | |
Window | - | Non-editable window elements; e.g. menus. /p> p> If it isn't a Button, View, or Tooltip, it is probably a Window. | |
Button | - | Buttons. /p> p> In addition to buttons, "button-like" controls such as non-editable dropdowns should also use this role. | |
Selection | - | Selected items in views. /p> p> Note that unfocused or disabled selections should use the Window role. This makes it more obvious to the user that the view containing the selection does not have input focus. | |
Tooltip | - | Tooltips. /p> p> The tooltip set can often be substituted for the view set when editing is not possible, but the Window set is deemed inappropriate. "What's This" help is an excellent example, another might be pop-up notifications (depending on taste). |
FocusColor | - | Color used to draw decorations for items which have input focus. | |
HoverColor | - | Color used to draw decorations for items which will be activated by clicking. |
NormalText | - | Normal foreground. | |
InactiveText | - | Second color, e.g. comments, items which are old, inactive or disabled. | |
ActiveText | - | Third color, e.g. items which are new, active, requesting attention, etc. May be used as a hover color for clickable items. | |
LinkText | - | Fourth color, e.g. (unvisited) links or other clickable items. | |
VisitedText | - | Fifth color, e.g. (visited) links. | |
NegativeText | - | Sixth color, e.g. errors, untrusted content, etc. | |
NeutralText | - | Seventh color, e.g. warnings, secure/encrypted content. | |
PositiveText | - | Eigth color, e.g. success messages, trusted content. |
LightShade | - | The light color is lighter than dark() or shadow() and contrasts with the base color. | |
MidlightShade | - | The midlight color is in between base() and light(). | |
MidShade | - | The mid color is in between base() and dark(). | |
DarkShade | - | The dark color is in between mid() and shadow(). | |
ShadowShade | - | The shadow color is darker than light() or midlight() and contrasts the base color. |