1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650
|
<?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.9 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"> </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> </td><td class="memItemRight" valign="bottom">{ NormalBackground, AlternateBackground, ActiveBackground, LinkBackground, VisitedBackground, NegativeBackground, NeutralBackground, PositiveBackground }</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="#ColorSet">ColorSet</a> </td><td class="memItemRight" valign="bottom">{ View, Window, Button, Selection, Tooltip }</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="#DecorationRole">DecorationRole</a> </td><td class="memItemRight" valign="bottom">{ FocusColor, HoverColor }</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="#ForegroundRole">ForegroundRole</a> </td><td class="memItemRight" valign="bottom">{ NormalText, InactiveText, ActiveText, LinkText, VisitedText, NegativeText, NeutralText, PositiveText }</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="#ShadeRole">ShadeRole</a> </td><td class="memItemRight" valign="bottom">{ LightShade, MidlightShade, MidShade, DarkShade, ShadowShade }</td></tr>
<tr><td colspan="2"><br><h2>Methods</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </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"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#KColorScheme">__init__</a> (self, QPalette::ColorGroup a0, <a href="../kdeui/KColorScheme.html#ColorSet">KColorScheme.ColorSet</a> a1=KColorScheme.View, KSharedPtr<KSharedConfig> a2=KSharedConfigPtr())</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">QBrush </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">QBrush </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">QBrush </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">QColor </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 colspan="2"><br><h2>Static Methods</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#adjustBackground">adjustBackground</a> (QPalette a0, <a href="../kdeui/KColorScheme.html#BackgroundRole">KColorScheme.BackgroundRole</a> newRole=KColorScheme.NormalBackground, QPalette::ColorRole color=QPalette.Base, <a href="../kdeui/KColorScheme.html#ColorSet">KColorScheme.ColorSet</a> set=KColorScheme.View, KSharedPtr<KSharedConfig> a4=KSharedConfigPtr())</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#adjustForeground">adjustForeground</a> (QPalette a0, <a href="../kdeui/KColorScheme.html#ForegroundRole">KColorScheme.ForegroundRole</a> newRole=KColorScheme.NormalText, QPalette::ColorRole color=QPalette.Text, <a href="../kdeui/KColorScheme.html#ColorSet">KColorScheme.ColorSet</a> set=KColorScheme.View, KSharedPtr<KSharedConfig> a4=KSharedConfigPtr())</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">QColor </td><td class="memItemRight" valign="bottom"><a class="el" href="#shade">shade</a> (QColor a0, <a href="../kdeui/KColorScheme.html#ShadeRole">KColorScheme.ShadeRole</a> a1)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">QColor </td><td class="memItemRight" valign="bottom"><a class="el" href="#shade">shade</a> (QColor 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"> <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> </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"> <em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype">QPalette::ColorGroup </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> </td>
<td class="paramname"><em>a1=KColorScheme.View</em>, </td>
</tr>
<tr>
<td class="memname"></td>
<td></td>
<td class="paramtype">KSharedPtr<KSharedConfig> </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="background"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname">QBrush background</td>
<td>(</td>
<td class="paramtype"> <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> </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">QBrush decoration</td>
<td>(</td>
<td class="paramtype"> <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> </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">QBrush foreground</td>
<td>(</td>
<td class="paramtype"> <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> </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">QColor shade</td>
<td>(</td>
<td class="paramtype"> <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> </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> </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> </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>Static Method Documentation</h2><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">QPalette </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> </td>
<td class="paramname"><em>newRole=KColorScheme.NormalBackground</em>, </td>
</tr>
<tr>
<td class="memname"></td>
<td></td>
<td class="paramtype">QPalette::ColorRole </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> </td>
<td class="paramname"><em>set=KColorScheme.View</em>, </td>
</tr>
<tr>
<td class="memname"></td>
<td></td>
<td class="paramtype">KSharedPtr<KSharedConfig> </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">QPalette </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> </td>
<td class="paramname"><em>newRole=KColorScheme.NormalText</em>, </td>
</tr>
<tr>
<td class="memname"></td>
<td></td>
<td class="paramtype">QPalette::ColorRole </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> </td>
<td class="paramname"><em>set=KColorScheme.View</em>, </td>
</tr>
<tr>
<td class="memname"></td>
<td></td>
<td class="paramtype">KSharedPtr<KSharedConfig> </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="shade"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname">QColor shade</td>
<td>(</td>
<td class="paramtype">QColor </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> </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> </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> </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">QColor shade</td>
<td>(</td>
<td class="paramtype">QColor </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> </td>
<td class="paramname"><em>a1</em>, </td>
</tr>
<tr>
<td class="memname"></td>
<td></td>
<td class="paramtype">float </td>
<td class="paramname"><em>contrast</em>, </td>
</tr>
<tr>
<td class="memname"></td>
<td></td>
<td class="paramtype">float </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> </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> </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> = 0</td><td><tr><td valign="top"><em>AlternateBackground</em> = 1</td><td><tr><td valign="top"><em>ActiveBackground</em> = 2</td><td><tr><td valign="top"><em>LinkBackground</em> = 3</td><td><tr><td valign="top"><em>VisitedBackground</em> = 4</td><td><tr><td valign="top"><em>NegativeBackground</em> = 5</td><td><tr><td valign="top"><em>NeutralBackground</em> = 6</td><td><tr><td valign="top"><em>PositiveBackground</em> = 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> </td><td><tr><td valign="top"><em>Window</em> </td><td><tr><td valign="top"><em>Button</em> </td><td><tr><td valign="top"><em>Selection</em> </td><td><tr><td valign="top"><em>Tooltip</em> </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> </td><td><tr><td valign="top"><em>HoverColor</em> </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> = 0</td><td><tr><td valign="top"><em>InactiveText</em> = 1</td><td><tr><td valign="top"><em>ActiveText</em> = 2</td><td><tr><td valign="top"><em>LinkText</em> = 3</td><td><tr><td valign="top"><em>VisitedText</em> = 4</td><td><tr><td valign="top"><em>NegativeText</em> = 5</td><td><tr><td valign="top"><em>NeutralText</em> = 6</td><td><tr><td valign="top"><em>PositiveText</em> = 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> </td><td><tr><td valign="top"><em>MidlightShade</em> </td><td><tr><td valign="top"><em>MidShade</em> </td><td><tr><td valign="top"><em>DarkShade</em> </td><td><tr><td valign="top"><em>ShadowShade</em> </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="mailto:simon@simonzone.com">Simon Edwards</a>.<br />
KDE<sup>®</sup> and <a href="../images/kde_gear_black.png">the K Desktop Environment<sup>®</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>
|