Sophie

Sophie

distrib > Mandriva > current > i586 > media > main-updates > by-pkgid > b77dda48f87d4eda8cc559e40c49a652 > files > 389

python-kde4-doc-4.4.5-0.2mdv2010.2.i586.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">

<head>
  <title>KColorScheme</title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta http-equiv="Content-Style-Type" content="text/css" />
  <link rel="stylesheet" type="text/css" href="../common/doxygen.css" />
  <link rel="stylesheet" media="screen" type="text/css" title="KDE Colors" href="../common/kde.css" />
</head>
<body>
<div id="container">
<div id="header">
  <div id="header_top">
    <div>
      <div>
        <img alt ="" src="../common/top-kde.jpg"/>
        KDE 4.4 PyKDE API Reference
      </div>
    </div>
  </div>
  <div id="header_bottom">
    <div id="location">
      <ul>
        <li>KDE's Python API</li>
      </ul>
    </div>

    <div id="menu">
      <ul>
        <li><a href="../modules.html">Overview</a></li>
<li><a href="http://techbase.kde.org/Development/Languages/Python">PyKDE Home</a></li>
<li><a href="http://kde.org/family/">Sitemap</a></li>
<li><a href="http://kde.org/contact/">Contact Us</a></li>
</ul>
    </div>
  </div>
</div>

<div id="body_wrapper">
<div id="body">
<div id="right">
<div class="content">
<div id="main">
<div class="clearer">&nbsp;</div>

<h1>KColorScheme Class Reference</h1>
<code>from PyKDE4.kdeui import *</code>
<p>



<h2>Detailed Description</h2>

<p>A set of methods used to work with colors.
</p>
<p>
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.
</p>
<p>
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.
</p>
<p>
<dl class="note" compact><dt><b>Note:</b></dt><dd>
Historically, it was not needed for applications to give much concern to the
state of a widget (active, inactive, disabled) since only the disabled state
was different, and only slightly. As a result, the old KGlobalSettings color
getters did not care about the widget state. However, starting with KDE4,
the color palettes for the various states may be wildly different.
Therefore, it is important to take the state into account. This is why the
KColorScheme constructor requires a QPalette.ColorGroup as an argument.
</dd></dl> </p>
<p>
To facilitate working with potentially-varying states, two convenience API's
are provided. These are KColorScheme.adjustBackground and its sister
KColorScheme.adjustForeground, and the helper class .KStatefulBrush.
</p>
<p>
<dl class="see" compact><dt><b>See also:</b></dt><dd> KColorScheme.ColorSet, KColorScheme.ForegroundRole,
KColorScheme.BackgroundRole, KColorScheme.DecorationRole,
KColorScheme.ShadeRole
</dd></dl>
</p>
<table border="0" cellpadding="0" cellspacing="0"><tr><td colspan="2"><br><h2>Enumerations</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="#BackgroundRole">BackgroundRole</a>&nbsp;</td><td class="memItemRight" valign="bottom">{&nbsp;NormalBackground, AlternateBackground, ActiveBackground, LinkBackground, VisitedBackground, NegativeBackground, NeutralBackground, PositiveBackground&nbsp;}</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="#ColorSet">ColorSet</a>&nbsp;</td><td class="memItemRight" valign="bottom">{&nbsp;View, Window, Button, Selection, Tooltip&nbsp;}</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="#DecorationRole">DecorationRole</a>&nbsp;</td><td class="memItemRight" valign="bottom">{&nbsp;FocusColor, HoverColor&nbsp;}</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="#ForegroundRole">ForegroundRole</a>&nbsp;</td><td class="memItemRight" valign="bottom">{&nbsp;NormalText, InactiveText, ActiveText, LinkText, VisitedText, NegativeText, NeutralText, PositiveText&nbsp;}</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="#ShadeRole">ShadeRole</a>&nbsp;</td><td class="memItemRight" valign="bottom">{&nbsp;LightShade, MidlightShade, MidShade, DarkShade, ShadowShade&nbsp;}</td></tr>
<tr><td colspan="2"><br><h2>Methods</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#KColorScheme">__init__</a> (self, <a href="../kdeui/KColorScheme.html">KColorScheme</a> a0)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#KColorScheme">__init__</a> (self, <a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qpalette::colorgroup.html">QPalette.ColorGroup</a> a0, <a href="../kdeui/KColorScheme.html#ColorSet">KColorScheme.ColorSet</a> a1=KColorScheme.View, <a href="../kdecore/KSharedConfigPtr.html">KSharedConfigPtr</a> a2=KSharedConfigPtr())</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#adjustBackground">adjustBackground</a> (self, <a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qpalette.html">QPalette</a> a0, <a href="../kdeui/KColorScheme.html#BackgroundRole">KColorScheme.BackgroundRole</a> newRole=KColorScheme.NormalBackground, <a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qpalette::colorrole.html">QPalette.ColorRole</a> color=QPalette.Base, <a href="../kdeui/KColorScheme.html#ColorSet">KColorScheme.ColorSet</a> set=KColorScheme.View, <a href="../kdecore/KSharedConfigPtr.html">KSharedConfigPtr</a> a4=KSharedConfigPtr())</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#adjustForeground">adjustForeground</a> (self, <a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qpalette.html">QPalette</a> a0, <a href="../kdeui/KColorScheme.html#ForegroundRole">KColorScheme.ForegroundRole</a> newRole=KColorScheme.NormalText, <a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qpalette::colorrole.html">QPalette.ColorRole</a> color=QPalette.Text, <a href="../kdeui/KColorScheme.html#ColorSet">KColorScheme.ColorSet</a> set=KColorScheme.View, <a href="../kdecore/KSharedConfigPtr.html">KSharedConfigPtr</a> a4=KSharedConfigPtr())</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qbrush.html">QBrush</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#background">background</a> (self, <a href="../kdeui/KColorScheme.html#BackgroundRole">KColorScheme.BackgroundRole</a> a0=KColorScheme.NormalBackground)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qbrush.html">QBrush</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#decoration">decoration</a> (self, <a href="../kdeui/KColorScheme.html#DecorationRole">KColorScheme.DecorationRole</a> a0)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qbrush.html">QBrush</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#foreground">foreground</a> (self, <a href="../kdeui/KColorScheme.html#ForegroundRole">KColorScheme.ForegroundRole</a> a0=KColorScheme.NormalText)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qcolor.html">QColor</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#shade">shade</a> (self, <a href="../kdeui/KColorScheme.html#ShadeRole">KColorScheme.ShadeRole</a> a0)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qcolor.html">QColor</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#shade">shade</a> (self, <a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qcolor.html">QColor</a> a0, <a href="../kdeui/KColorScheme.html#ShadeRole">KColorScheme.ShadeRole</a> a1)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qcolor.html">QColor</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#shade">shade</a> (self, <a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qcolor.html">QColor</a> a0, <a href="../kdeui/KColorScheme.html#ShadeRole">KColorScheme.ShadeRole</a> a1, float contrast, float chromaAdjust=0.0)</td></tr>
</table>
<hr><h2>Method Documentation</h2><a class="anchor" name="KColorScheme"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname">__init__</td>
<td>(</td>
<td class="paramtype">&nbsp;<em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="../kdeui/KColorScheme.html">KColorScheme</a>&nbsp;</td>
<td class="paramname"><em>a0</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"><p>Construct a copy of another KColorScheme.
</p></div></div><a class="anchor" name="KColorScheme"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname">__init__</td>
<td>(</td>
<td class="paramtype">&nbsp;<em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qpalette::colorgroup.html">QPalette.ColorGroup</a>&nbsp;</td>
<td class="paramname"><em>a0</em>, </td>
</tr>
<tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="../kdeui/KColorScheme.html#ColorSet">KColorScheme.ColorSet</a>&nbsp;</td>
<td class="paramname"><em>a1=KColorScheme.View</em>, </td>
</tr>
<tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="../kdecore/KSharedConfigPtr.html">KSharedConfigPtr</a>&nbsp;</td>
<td class="paramname"><em>a2=KSharedConfigPtr()</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"><p>Construct a palette from given color set and state, using the colors
from the given KConfig (if null, the system colors are used).
</p>
<p>
<dl class="note" compact><dt><b>Note:</b></dt><dd> KColorScheme provides direct access to the color scheme for users
that deal directly with widget states. Unless you are a low-level user
or have a legitimate reason to only care about a fixed, limited number
of states (e.g. windows that cannot be inactive), consider using a
.KStatefulBrush instead.
</dd></dl>
</p></div></div><a class="anchor" name="adjustBackground"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"> adjustBackground</td>
<td>(</td>
<td class="paramtype">&nbsp;<em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qpalette.html">QPalette</a>&nbsp;</td>
<td class="paramname"><em>a0</em>, </td>
</tr>
<tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="../kdeui/KColorScheme.html#BackgroundRole">KColorScheme.BackgroundRole</a>&nbsp;</td>
<td class="paramname"><em>newRole=KColorScheme.NormalBackground</em>, </td>
</tr>
<tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qpalette::colorrole.html">QPalette.ColorRole</a>&nbsp;</td>
<td class="paramname"><em>color=QPalette.Base</em>, </td>
</tr>
<tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="../kdeui/KColorScheme.html#ColorSet">KColorScheme.ColorSet</a>&nbsp;</td>
<td class="paramname"><em>set=KColorScheme.View</em>, </td>
</tr>
<tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="../kdecore/KSharedConfigPtr.html">KSharedConfigPtr</a>&nbsp;</td>
<td class="paramname"><em>a4=KSharedConfigPtr()</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"><p>Adjust a QPalette by replacing the specified QPalette.ColorRole with
the requested background color for all states. Using this method is
safer than replacing individual states, as it insulates you against
changes in QPalette.ColorGroup.
</p>
<p>
<dl class="note" compact><dt><b>Note:</b></dt><dd> Although it is possible to replace a foreground color using this
method, it's bad usability to do so. Just say "no".
</dd></dl>
</p></div></div><a class="anchor" name="adjustForeground"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"> adjustForeground</td>
<td>(</td>
<td class="paramtype">&nbsp;<em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qpalette.html">QPalette</a>&nbsp;</td>
<td class="paramname"><em>a0</em>, </td>
</tr>
<tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="../kdeui/KColorScheme.html#ForegroundRole">KColorScheme.ForegroundRole</a>&nbsp;</td>
<td class="paramname"><em>newRole=KColorScheme.NormalText</em>, </td>
</tr>
<tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qpalette::colorrole.html">QPalette.ColorRole</a>&nbsp;</td>
<td class="paramname"><em>color=QPalette.Text</em>, </td>
</tr>
<tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="../kdeui/KColorScheme.html#ColorSet">KColorScheme.ColorSet</a>&nbsp;</td>
<td class="paramname"><em>set=KColorScheme.View</em>, </td>
</tr>
<tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="../kdecore/KSharedConfigPtr.html">KSharedConfigPtr</a>&nbsp;</td>
<td class="paramname"><em>a4=KSharedConfigPtr()</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"><p>Adjust a QPalette by replacing the specified QPalette.ColorRole with
the requested foreground color for all states. Using this method is
safer than replacing individual states, as it insulates you against
changes in QPalette.ColorGroup.
</p>
<p>
<dl class="note" compact><dt><b>Note:</b></dt><dd> Although it is possible to replace a background color using this
method, it's bad usability to do so. Just say "no".
</dd></dl>
</p></div></div><a class="anchor" name="background"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"><a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qbrush.html">QBrush</a> background</td>
<td>(</td>
<td class="paramtype">&nbsp;<em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="../kdeui/KColorScheme.html#BackgroundRole">KColorScheme.BackgroundRole</a>&nbsp;</td>
<td class="paramname"><em>a0=KColorScheme.NormalBackground</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"><p>Retrieve the requested background brush.
</p></div></div><a class="anchor" name="decoration"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"><a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qbrush.html">QBrush</a> decoration</td>
<td>(</td>
<td class="paramtype">&nbsp;<em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="../kdeui/KColorScheme.html#DecorationRole">KColorScheme.DecorationRole</a>&nbsp;</td>
<td class="paramname"><em>a0</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"><p>Retrieve the requested decoration brush.
</p></div></div><a class="anchor" name="foreground"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"><a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qbrush.html">QBrush</a> foreground</td>
<td>(</td>
<td class="paramtype">&nbsp;<em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="../kdeui/KColorScheme.html#ForegroundRole">KColorScheme.ForegroundRole</a>&nbsp;</td>
<td class="paramname"><em>a0=KColorScheme.NormalText</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"><p>Retrieve the requested foreground brush.
</p></div></div><a class="anchor" name="shade"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"><a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qcolor.html">QColor</a> shade</td>
<td>(</td>
<td class="paramtype">&nbsp;<em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="../kdeui/KColorScheme.html#ShadeRole">KColorScheme.ShadeRole</a>&nbsp;</td>
<td class="paramname"><em>a0</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"><p>Retrieve the requested shade color, using the specified color as the
base color and the specified contrast.
</p>
<p>
</p><dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign="top"><em>contrast</em>&nbsp;</td><td> 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)

<tr><td></td><td valign="top"><em>chromaAdjust</em>&nbsp;</td><td> (optional) Amount by which to adjust the chroma of
the shade (1.0 means no adjustment)
</td></tr>
</table></dl>
<p> <dl class="note" compact><dt><b>Note:</b></dt><dd> 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().
</dd></dl> </p>
<p>
<dl class="see" compact><dt><b>See also:</b></dt><dd> KColorUtils.shade
</dd></dl>
</p></div></div><a class="anchor" name="shade"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"><a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qcolor.html">QColor</a> shade</td>
<td>(</td>
<td class="paramtype">&nbsp;<em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qcolor.html">QColor</a>&nbsp;</td>
<td class="paramname"><em>a0</em>, </td>
</tr>
<tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="../kdeui/KColorScheme.html#ShadeRole">KColorScheme.ShadeRole</a>&nbsp;</td>
<td class="paramname"><em>a1</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"><p>Retrieve the requested shade color, using the specified color as the
base color and the specified contrast.
</p>
<p>
</p><dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign="top"><em>contrast</em>&nbsp;</td><td> 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)

<tr><td></td><td valign="top"><em>chromaAdjust</em>&nbsp;</td><td> (optional) Amount by which to adjust the chroma of
the shade (1.0 means no adjustment)
</td></tr>
</table></dl>
<p> <dl class="note" compact><dt><b>Note:</b></dt><dd> 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().
</dd></dl> </p>
<p>
<dl class="see" compact><dt><b>See also:</b></dt><dd> KColorUtils.shade
</dd></dl>
</p></div></div><a class="anchor" name="shade"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"><a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qcolor.html">QColor</a> shade</td>
<td>(</td>
<td class="paramtype">&nbsp;<em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qcolor.html">QColor</a>&nbsp;</td>
<td class="paramname"><em>a0</em>, </td>
</tr>
<tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="../kdeui/KColorScheme.html#ShadeRole">KColorScheme.ShadeRole</a>&nbsp;</td>
<td class="paramname"><em>a1</em>, </td>
</tr>
<tr>
<td class="memname"></td>
<td></td>
<td class="paramtype">float&nbsp;</td>
<td class="paramname"><em>contrast</em>, </td>
</tr>
<tr>
<td class="memname"></td>
<td></td>
<td class="paramtype">float&nbsp;</td>
<td class="paramname"><em>chromaAdjust=0.0</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"><p>Retrieve the requested shade color, using the specified color as the
base color and the specified contrast.
</p>
<p>
</p><dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign="top"><em>contrast</em>&nbsp;</td><td> 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)

<tr><td></td><td valign="top"><em>chromaAdjust</em>&nbsp;</td><td> (optional) Amount by which to adjust the chroma of
the shade (1.0 means no adjustment)
</td></tr>
</table></dl>
<p> <dl class="note" compact><dt><b>Note:</b></dt><dd> 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().
</dd></dl> </p>
<p>
<dl class="see" compact><dt><b>See also:</b></dt><dd> KColorUtils.shade
</dd></dl>
</p></div></div><hr><h2>Enumeration Documentation</h2><a class="anchor" name="BackgroundRole"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr><td class="memname">BackgroundRole</td>
</tr>
</table>
</div>
<div class="memdoc"><p>This enumeration describes the background color being selected from the
given set.
</p>
<p>
Background colors are suitable for drawing under text, and should never
be used to draw text. In combination with one of the overloads of
KColorScheme.shade, they may be used to generate colors for drawing
frames, bevels, and similar decorations.
</p><dl compact><dt><b>Enumerator: </b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0"><tr><td valign="top"><em>NormalBackground</em>&nbsp;=&nbsp;0</td><td><tr><td valign="top"><em>AlternateBackground</em>&nbsp;=&nbsp;1</td><td><tr><td valign="top"><em>ActiveBackground</em>&nbsp;=&nbsp;2</td><td><tr><td valign="top"><em>LinkBackground</em>&nbsp;=&nbsp;3</td><td><tr><td valign="top"><em>VisitedBackground</em>&nbsp;=&nbsp;4</td><td><tr><td valign="top"><em>NegativeBackground</em>&nbsp;=&nbsp;5</td><td><tr><td valign="top"><em>NeutralBackground</em>&nbsp;=&nbsp;6</td><td><tr><td valign="top"><em>PositiveBackground</em>&nbsp;=&nbsp;7</td><td></table>
</dl>
</div></div><p><a class="anchor" name="ColorSet"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr><td class="memname">ColorSet</td>
</tr>
</table>
</div>
<div class="memdoc"><p>This enumeration describes the color set for which a color is being
selected.
</p>
<p>
Color sets define a color "environment", suitable for drawing all parts
of a given region. Colors from different sets should not be combined.
</p><dl compact><dt><b>Enumerator: </b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0"><tr><td valign="top"><em>View</em>&nbsp;</td><td><tr><td valign="top"><em>Window</em>&nbsp;</td><td><tr><td valign="top"><em>Button</em>&nbsp;</td><td><tr><td valign="top"><em>Selection</em>&nbsp;</td><td><tr><td valign="top"><em>Tooltip</em>&nbsp;</td><td></table>
</dl>
</div></div><p><a class="anchor" name="DecorationRole"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr><td class="memname">DecorationRole</td>
</tr>
</table>
</div>
<div class="memdoc"><p>This enumeration describes the decoration color being selected from the
given set.
</p>
<p>
Decoration colors are used to draw decorations (such as frames) for
special purposes. Like color shades, they are neither foreground nor
background colors. Text should not be painted over a decoration color,
and decoration colors should not be used to draw text.
</p><dl compact><dt><b>Enumerator: </b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0"><tr><td valign="top"><em>FocusColor</em>&nbsp;</td><td><tr><td valign="top"><em>HoverColor</em>&nbsp;</td><td></table>
</dl>
</div></div><p><a class="anchor" name="ForegroundRole"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr><td class="memname">ForegroundRole</td>
</tr>
</table>
</div>
<div class="memdoc"><p>This enumeration describes the foreground color being selected from the
given set.
</p>
<p>
Foreground colors are suitable for drawing text or glyphs (such as the
symbols on window decoration buttons, assuming a suitable background
brush is used), and should never be used to draw backgrounds.
</p>
<p>
For window decorations, the following is suggested, but not set in
stone:
<li> Maximize - PositiveText </li>
<li> Minimize - NeutralText </li>
<li> Close - NegativeText </li>
<li> WhatsThis - LinkText </li>
<li> Sticky - ActiveText </li>
</p><dl compact><dt><b>Enumerator: </b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0"><tr><td valign="top"><em>NormalText</em>&nbsp;=&nbsp;0</td><td><tr><td valign="top"><em>InactiveText</em>&nbsp;=&nbsp;1</td><td><tr><td valign="top"><em>ActiveText</em>&nbsp;=&nbsp;2</td><td><tr><td valign="top"><em>LinkText</em>&nbsp;=&nbsp;3</td><td><tr><td valign="top"><em>VisitedText</em>&nbsp;=&nbsp;4</td><td><tr><td valign="top"><em>NegativeText</em>&nbsp;=&nbsp;5</td><td><tr><td valign="top"><em>NeutralText</em>&nbsp;=&nbsp;6</td><td><tr><td valign="top"><em>PositiveText</em>&nbsp;=&nbsp;7</td><td></table>
</dl>
</div></div><p><a class="anchor" name="ShadeRole"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr><td class="memname">ShadeRole</td>
</tr>
</table>
</div>
<div class="memdoc"><p>This enumeration describes the color shade being selected from the given
set.
</p>
<p>
Color shades are used to draw "3d" elements, such as frames and bevels.
They are neither foreground nor background colors. Text should not be
painted over a shade, and shades should not be used to draw text.
</p><dl compact><dt><b>Enumerator: </b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0"><tr><td valign="top"><em>LightShade</em>&nbsp;</td><td><tr><td valign="top"><em>MidlightShade</em>&nbsp;</td><td><tr><td valign="top"><em>MidShade</em>&nbsp;</td><td><tr><td valign="top"><em>DarkShade</em>&nbsp;</td><td><tr><td valign="top"><em>ShadowShade</em>&nbsp;</td><td></table>
</dl>
</div></div><p>
</div>
</div>
</div>

<div id="left">

<div class="menu_box">
<div class="nav_list">
<ul>
<li><a href="../allclasses.html">Full Index</a></li>
</ul>
</div>

<a name="cp-menu" /><div class="menutitle"><div>
  <h2 id="cp-menu-project">Modules</h2>
</div></div>
<div class="nav_list">
<ul><li><a href="../akonadi/index.html">akonadi</a></li>
<li><a href="../dnssd/index.html">dnssd</a></li>
<li><a href="../kdecore/index.html">kdecore</a></li>
<li><a href="../kdeui/index.html">kdeui</a></li>
<li><a href="../khtml/index.html">khtml</a></li>
<li><a href="../kio/index.html">kio</a></li>
<li><a href="../knewstuff/index.html">knewstuff</a></li>
<li><a href="../kparts/index.html">kparts</a></li>
<li><a href="../kutils/index.html">kutils</a></li>
<li><a href="../nepomuk/index.html">nepomuk</a></li>
<li><a href="../phonon/index.html">phonon</a></li>
<li><a href="../plasma/index.html">plasma</a></li>
<li><a href="../polkitqt/index.html">polkitqt</a></li>
<li><a href="../solid/index.html">solid</a></li>
<li><a href="../soprano/index.html">soprano</a></li>
</ul></div></div>

</div>

</div>
  <div class="clearer"/>
</div>

<div id="end_body"></div>
</div>
<div id="footer"><div id="footer_text">
This documentation is maintained by <a href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;simon&#64;simonzone&#46;com">Simon Edwards</a>.<br />
        KDE<sup>&#174;</sup> and <a href="../images/kde_gear_black.png">the K Desktop Environment<sup>&#174;</sup> logo</a> are registered trademarks of <a href="http://ev.kde.org/" title="Homepage of the KDE non-profit Organization">KDE e.V.</a> |
        <a href="http://www.kde.org/contact/impressum.php">Legal</a>
    </div></div>
</body>
</html>