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 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898
|
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qcolor.cpp -->
<title>Qt 4.8: QColor Class Reference</title>
<link rel="stylesheet" type="text/css" href="style/offline.css" />
</head>
<body>
<div class="header" id="qtdocheader">
<div class="content">
<a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a>
</div>
<div class="breadcrumb toolblock">
<ul>
<li class="first"><a href="index.html">Home</a></li>
<!-- Breadcrumbs go here -->
<li><a href="modules.html">Modules</a></li>
<li><a href="qtgui.html">QtGui</a></li>
<li>QColor</li>
</ul>
</div>
</div>
<div class="content mainContent">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-types">Public Types</a></li>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#static-public-members">Static Public Members</a></li>
<li class="level1"><a href="#related-non-members">Related Non-Members</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
<li class="level2"><a href="#integer-vs-floating-point-precision">Integer vs. Floating Point Precision</a></li>
<li class="level2"><a href="#alpha-blended-drawing">Alpha-Blended Drawing</a></li>
<li class="level2"><a href="#predefined-colors">Predefined Colors</a></li>
<li class="level2"><a href="#the-hsv-color-model">The HSV Color Model</a></li>
<li class="level2"><a href="#the-hsl-color-model">The HSL Color Model</a></li>
<li class="level2"><a href="#the-cmyk-color-model">The CMYK Color Model</a></li>
</ul>
</div>
<h1 class="title">QColor Class Reference</h1>
<!-- $$$QColor-brief -->
<p>The QColor class provides colors based on RGB, HSV or CMYK values. <a href="#details">More...</a></p>
<!-- @@@QColor -->
<pre class="cpp"> <span class="preprocessor">#include <QColor></span></pre><ul>
<li><a href="qcolor-members.html">List of all members, including inherited members</a></li>
<li><a href="qcolor-obsolete.html">Obsolete members</a></li>
<li><a href="qcolor-qt3.html">Qt 3 support members</a></li>
</ul>
<a name="public-types"></a>
<h2>Public Types</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#Spec-enum">Spec</a></b> { Rgb, Hsv, Cmyk, Hsl, Invalid }</td></tr>
</table>
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#QColor">QColor</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#QColor-2">QColor</a></b> ( int <i>r</i>, int <i>g</i>, int <i>b</i>, int <i>a</i> = 255 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#QColor-3">QColor</a></b> ( QRgb <i>color</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#QColor-4">QColor</a></b> ( const QString & <i>name</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#QColor-5">QColor</a></b> ( const char * <i>name</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#QColor-6">QColor</a></b> ( const QColor & <i>color</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#QColor-9">QColor</a></b> ( Qt::GlobalColor <i>color</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#alpha">alpha</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#alphaF">alphaF</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#black">black</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#blackF">blackF</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#blue">blue</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#blueF">blueF</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QColor </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#convertTo">convertTo</a></b> ( Spec <i>colorSpec</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#cyan">cyan</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#cyanF">cyanF</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QColor </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#darker">darker</a></b> ( int <i>factor</i> = 200 ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#getCmyk">getCmyk</a></b> ( int * <i>c</i>, int * <i>m</i>, int * <i>y</i>, int * <i>k</i>, int * <i>a</i> = 0 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#getCmykF">getCmykF</a></b> ( qreal * <i>c</i>, qreal * <i>m</i>, qreal * <i>y</i>, qreal * <i>k</i>, qreal * <i>a</i> = 0 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#getHsl">getHsl</a></b> ( int * <i>h</i>, int * <i>s</i>, int * <i>l</i>, int * <i>a</i> = 0 ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#getHslF">getHslF</a></b> ( qreal * <i>h</i>, qreal * <i>s</i>, qreal * <i>l</i>, qreal * <i>a</i> = 0 ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#getHsv">getHsv</a></b> ( int * <i>h</i>, int * <i>s</i>, int * <i>v</i>, int * <i>a</i> = 0 ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#getHsvF">getHsvF</a></b> ( qreal * <i>h</i>, qreal * <i>s</i>, qreal * <i>v</i>, qreal * <i>a</i> = 0 ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#getRgb">getRgb</a></b> ( int * <i>r</i>, int * <i>g</i>, int * <i>b</i>, int * <i>a</i> = 0 ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#getRgbF">getRgbF</a></b> ( qreal * <i>r</i>, qreal * <i>g</i>, qreal * <i>b</i>, qreal * <i>a</i> = 0 ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#green">green</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#greenF">greenF</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#hslHue">hslHue</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#hslHueF">hslHueF</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#hslSaturation">hslSaturation</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#hslSaturationF">hslSaturationF</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#hsvHue">hsvHue</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#hsvHueF">hsvHueF</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#hsvSaturation">hsvSaturation</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#hsvSaturationF">hsvSaturationF</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#hue">hue</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#hueF">hueF</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#isValid">isValid</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QColor </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#lighter">lighter</a></b> ( int <i>factor</i> = 150 ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#lightness">lightness</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#lightnessF">lightnessF</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#magenta">magenta</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#magentaF">magentaF</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#name">name</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#red">red</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#redF">redF</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRgb </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#rgb">rgb</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRgb </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#rgba">rgba</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#saturation">saturation</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#saturationF">saturationF</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#setAlpha">setAlpha</a></b> ( int <i>alpha</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#setAlphaF">setAlphaF</a></b> ( qreal <i>alpha</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#setBlue">setBlue</a></b> ( int <i>blue</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#setBlueF">setBlueF</a></b> ( qreal <i>blue</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#setCmyk">setCmyk</a></b> ( int <i>c</i>, int <i>m</i>, int <i>y</i>, int <i>k</i>, int <i>a</i> = 255 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#setCmykF">setCmykF</a></b> ( qreal <i>c</i>, qreal <i>m</i>, qreal <i>y</i>, qreal <i>k</i>, qreal <i>a</i> = 1.0 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#setGreen">setGreen</a></b> ( int <i>green</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#setGreenF">setGreenF</a></b> ( qreal <i>green</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#setHsl">setHsl</a></b> ( int <i>h</i>, int <i>s</i>, int <i>l</i>, int <i>a</i> = 255 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#setHslF">setHslF</a></b> ( qreal <i>h</i>, qreal <i>s</i>, qreal <i>l</i>, qreal <i>a</i> = 1.0 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#setHsv">setHsv</a></b> ( int <i>h</i>, int <i>s</i>, int <i>v</i>, int <i>a</i> = 255 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#setHsvF">setHsvF</a></b> ( qreal <i>h</i>, qreal <i>s</i>, qreal <i>v</i>, qreal <i>a</i> = 1.0 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#setNamedColor">setNamedColor</a></b> ( const QString & <i>name</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#setRed">setRed</a></b> ( int <i>red</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#setRedF">setRedF</a></b> ( qreal <i>red</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#setRgb">setRgb</a></b> ( int <i>r</i>, int <i>g</i>, int <i>b</i>, int <i>a</i> = 255 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#setRgb-2">setRgb</a></b> ( QRgb <i>rgb</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#setRgbF">setRgbF</a></b> ( qreal <i>r</i>, qreal <i>g</i>, qreal <i>b</i>, qreal <i>a</i> = 1.0 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#setRgba">setRgba</a></b> ( QRgb <i>rgba</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> Spec </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#spec">spec</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QColor </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#toCmyk">toCmyk</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QColor </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#toHsl">toHsl</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QColor </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#toHsv">toHsv</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QColor </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#toRgb">toRgb</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#value">value</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#valueF">valueF</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#yellow">yellow</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#yellowF">yellowF</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#operator-QVariant">operator QVariant</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#operator-not-eq">operator!=</a></b> ( const QColor & <i>color</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QColor & </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#operator-eq">operator=</a></b> ( const QColor & <i>color</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QColor & </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#operator-eq-2">operator=</a></b> ( Qt::GlobalColor <i>color</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#operator-eq-eq">operator==</a></b> ( const QColor & <i>color</i> ) const</td></tr>
</table>
<a name="static-public-members"></a>
<h2>Static Public Members</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#allowX11ColorNames">allowX11ColorNames</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QStringList </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#colorNames">colorNames</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QColor </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#fromCmyk">fromCmyk</a></b> ( int <i>c</i>, int <i>m</i>, int <i>y</i>, int <i>k</i>, int <i>a</i> = 255 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QColor </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#fromCmykF">fromCmykF</a></b> ( qreal <i>c</i>, qreal <i>m</i>, qreal <i>y</i>, qreal <i>k</i>, qreal <i>a</i> = 1.0 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QColor </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#fromHsl">fromHsl</a></b> ( int <i>h</i>, int <i>s</i>, int <i>l</i>, int <i>a</i> = 255 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QColor </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#fromHslF">fromHslF</a></b> ( qreal <i>h</i>, qreal <i>s</i>, qreal <i>l</i>, qreal <i>a</i> = 1.0 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QColor </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#fromHsv">fromHsv</a></b> ( int <i>h</i>, int <i>s</i>, int <i>v</i>, int <i>a</i> = 255 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QColor </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#fromHsvF">fromHsvF</a></b> ( qreal <i>h</i>, qreal <i>s</i>, qreal <i>v</i>, qreal <i>a</i> = 1.0 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QColor </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#fromRgb">fromRgb</a></b> ( QRgb <i>rgb</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QColor </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#fromRgb-2">fromRgb</a></b> ( int <i>r</i>, int <i>g</i>, int <i>b</i>, int <i>a</i> = 255 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QColor </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#fromRgbF">fromRgbF</a></b> ( qreal <i>r</i>, qreal <i>g</i>, qreal <i>b</i>, qreal <i>a</i> = 1.0 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QColor </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#fromRgba">fromRgba</a></b> ( QRgb <i>rgba</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#isValidColor">isValidColor</a></b> ( const QString & <i>name</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#setAllowX11ColorNames">setAllowX11ColorNames</a></b> ( bool <i>enabled</i> )</td></tr>
</table>
<a name="related-non-members"></a>
<h2>Related Non-Members</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> typedef </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#QRgb-typedef">QRgb</a></b></td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#qAlpha">qAlpha</a></b> ( QRgb <i>rgba</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#qBlue">qBlue</a></b> ( QRgb <i>rgb</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#qGray">qGray</a></b> ( int <i>r</i>, int <i>g</i>, int <i>b</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#qGray-2">qGray</a></b> ( QRgb <i>rgb</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#qGreen">qGreen</a></b> ( QRgb <i>rgb</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#qRed">qRed</a></b> ( QRgb <i>rgb</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRgb </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#qRgb">qRgb</a></b> ( int <i>r</i>, int <i>g</i>, int <i>b</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRgb </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#qRgba">qRgba</a></b> ( int <i>r</i>, int <i>g</i>, int <i>b</i>, int <i>a</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDataStream & </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#operator-lt-lt-46">operator<<</a></b> ( QDataStream & <i>stream</i>, const QColor & <i>color</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDataStream & </td><td class="memItemRight bottomAlign"><b><a href="qcolor.html#operator-gt-gt-24">operator>></a></b> ( QDataStream & <i>stream</i>, QColor & <i>color</i> )</td></tr>
</table>
<a name="details"></a>
<!-- $$$QColor-description -->
<div class="descr">
<h2>Detailed Description</h2>
<p>The QColor class provides colors based on RGB, HSV or CMYK values.</p>
<p>A color is normally specified in terms of RGB (red, green, and blue) components, but it is also possible to specify it in terms of HSV (hue, saturation, and value) and CMYK (cyan, magenta, yellow and black) components. In addition a color can be specified using a color name. The color name can be any of the SVG 1.0 color names.</p>
<table class="generic">
<thead><tr class="qt-style"><th >RGB</th><th >HSV</th><th >CMYK</th></tr></thead>
<tr valign="top" class="odd"><td ><img src="images/qcolor-rgb.png" alt="" /></td><td ><img src="images/qcolor-hsv.png" alt="" /></td><td ><img src="images/qcolor-cmyk.png" alt="" /></td></tr>
</table>
<p>The QColor constructor creates the color based on RGB values. To create a QColor based on either HSV or CMYK values, use the <a href="qcolor.html#toHsv">toHsv</a>() and <a href="qcolor.html#toCmyk">toCmyk</a>() functions respectively. These functions return a copy of the color using the desired format. In addition the static <a href="qcolor.html#fromRgb">fromRgb</a>(), <a href="qcolor.html#fromHsv">fromHsv</a>() and <a href="qcolor.html#fromCmyk">fromCmyk</a>() functions create colors from the specified values. Alternatively, a color can be converted to any of the three formats using the <a href="qcolor.html#convertTo">convertTo</a>() function (returning a copy of the color in the desired format), or any of the <a href="qcolor.html#setRgb">setRgb</a>(), <a href="qcolor.html#setHsv">setHsv</a>() and <a href="qcolor.html#setCmyk">setCmyk</a>() functions altering <i>this</i> color's format. The <a href="qcolor.html#spec">spec</a>() function tells how the color was specified.</p>
<p>A color can be set by passing an RGB string (such as "#112233"), or a color name (such as "blue"), to the <a href="qcolor.html#setNamedColor">setNamedColor</a>() function. The color names are taken from the SVG 1.0 color names. The <a href="qcolor.html#name">name</a>() function returns the name of the color in the format "#RRGGBB". Colors can also be set using <a href="qcolor.html#setRgb">setRgb</a>(), <a href="qcolor.html#setHsv">setHsv</a>() and <a href="qcolor.html#setCmyk">setCmyk</a>(). To get a lighter or darker color use the <a href="qcolor.html#lighter">lighter</a>() and <a href="qcolor.html#darker">darker</a>() functions respectively.</p>
<p>The <a href="qcolor.html#isValid">isValid</a>() function indicates whether a QColor is legal at all. For example, a RGB color with RGB values out of range is illegal. For performance reasons, QColor mostly disregards illegal colors, and for that reason, the result of using an invalid color is undefined.</p>
<p>The color components can be retrieved individually, e.g with <a href="qcolor.html#red">red</a>(), <a href="qcolor.html#hue">hue</a>() and <a href="qcolor.html#cyan">cyan</a>(). The values of the color components can also be retrieved in one go using the <a href="qcolor.html#getRgb">getRgb</a>(), <a href="qcolor.html#getHsv">getHsv</a>() and <a href="qcolor.html#getCmyk">getCmyk</a>() functions. Using the RGB color model, the color components can in addition be accessed with <a href="qcolor.html#rgb">rgb</a>().</p>
<p>There are several related non-members: <a href="qcolor.html#QRgb-typedef">QRgb</a> is a typdef for an unsigned int representing the RGB value triplet (r, g, b). Note that it also can hold a value for the alpha-channel (for more information, see the <a href="#alpha-blended-drawing">Alpha-Blended Drawing</a> section). The <a href="qcolor.html#qRed">qRed</a>(), <a href="qcolor.html#qBlue">qBlue</a>() and <a href="qcolor.html#qGreen">qGreen</a>() functions return the respective component of the given <a href="qcolor.html#QRgb-typedef">QRgb</a> value, while the <a href="qcolor.html#qRgb">qRgb</a>() and <a href="qcolor.html#qRgba">qRgba</a>() functions create and return the <a href="qcolor.html#QRgb-typedef">QRgb</a> triplet based on the given component values. Finally, the <a href="qcolor.html#qAlpha">qAlpha</a>() function returns the alpha component of the provided <a href="qcolor.html#QRgb-typedef">QRgb</a>, and the <a href="qcolor.html#qGray">qGray</a>() function calculates and return a gray value based on the given value.</p>
<p>QColor is platform and device independent. The <a href="qcolormap.html">QColormap</a> class maps the color to the hardware.</p>
<p>For more information about painting in general, see the <a href="paintsystem.html">Paint System</a> documentation.</p>
<a name="integer-vs-floating-point-precision"></a>
<h3>Integer vs. Floating Point Precision</h3>
<p>QColor supports floating point precision and provides floating point versions of all the color components functions, e.g. <a href="qcolor.html#getRgbF">getRgbF</a>(), <a href="qcolor.html#hueF">hueF</a>() and <a href="qcolor.html#fromCmykF">fromCmykF</a>(). Note that since the components are stored using 16-bit integers, there might be minor deviations between the values set using, for example, <a href="qcolor.html#setRgbF">setRgbF</a>() and the values returned by the <a href="qcolor.html#getRgbF">getRgbF</a>() function due to rounding.</p>
<p>While the integer based functions take values in the range 0-255 (except <a href="qcolor.html#hue">hue</a>() which must have values within the range 0-359), the floating point functions accept values in the range 0.0 - 1.0.</p>
<a name="alpha-blended-drawing"></a>
<h3>Alpha-Blended Drawing</h3>
<p>QColor also support alpha-blended outlining and filling. The alpha channel of a color specifies the transparency effect, 0 represents a fully transparent color, while 255 represents a fully opaque color. For example:</p>
<pre class="cpp"> <span class="comment">// Specify semi-transparent red</span>
painter<span class="operator">.</span>setBrush(<span class="type">QColor</span>(<span class="number">255</span><span class="operator">,</span> <span class="number">0</span><span class="operator">,</span> <span class="number">0</span><span class="operator">,</span> <span class="number">127</span>));
painter<span class="operator">.</span>drawRect(<span class="number">0</span><span class="operator">,</span> <span class="number">0</span><span class="operator">,</span> width()<span class="operator">/</span><span class="number">2</span><span class="operator">,</span> height());
<span class="comment">// Specify semi-transparent blue</span>
painter<span class="operator">.</span>setBrush(<span class="type">QColor</span>(<span class="number">0</span><span class="operator">,</span> <span class="number">0</span><span class="operator">,</span> <span class="number">255</span><span class="operator">,</span> <span class="number">127</span>));
painter<span class="operator">.</span>drawRect(<span class="number">0</span><span class="operator">,</span> <span class="number">0</span><span class="operator">,</span> width()<span class="operator">,</span> height()<span class="operator">/</span><span class="number">2</span>);</pre>
<p>The code above produces the following output:</p>
<p class="centerAlign"><img src="images/alphafill.png" alt="" /></p><p>Alpha-blended drawing is supported on Windows, Mac OS X, and on X11 systems that have the X Render extension installed.</p>
<p>The alpha channel of a color can be retrieved and set using the <a href="qcolor.html#alpha">alpha</a>() and <a href="qcolor.html#setAlpha">setAlpha</a>() functions if its value is an integer, and <a href="qcolor.html#alphaF">alphaF</a>() and <a href="qcolor.html#setAlphaF">setAlphaF</a>() if its value is qreal (double). By default, the alpha-channel is set to 255 (opaque). To retrieve and set <i>all</i> the RGB color components (including the alpha-channel) in one go, use the <a href="qcolor.html#rgba">rgba</a>() and <a href="qcolor.html#setRgba">setRgba</a>() functions.</p>
<a name="predefined-colors"></a>
<h3>Predefined Colors</h3>
<p>There are 20 predefined QColors described by the <a href="qt.html#GlobalColor-enum">Qt::GlobalColor</a> enum, including black, white, primary and secondary colors, darker versions of these colors and three shades of gray. QColor also recognizes a variety of color names; the static <a href="qcolor.html#colorNames">colorNames</a>() function returns a <a href="qstringlist.html">QStringList</a> color names that QColor knows about.</p>
<p class="centerAlign"><img src="images/qt-colors.png" alt="Qt Colors" /></p><p>Additionally, the <a href="qt.html#GlobalColor-enum">Qt::color0</a>, <a href="qt.html#GlobalColor-enum">Qt::color1</a> and <a href="qt.html#GlobalColor-enum">Qt::transparent</a> colors are used for special purposes.</p>
<p><a href="qt.html#GlobalColor-enum">Qt::color0</a> (zero pixel value) and <a href="qt.html#GlobalColor-enum">Qt::color1</a> (non-zero pixel value) are special colors for drawing in QBitmaps. Painting with <a href="qt.html#GlobalColor-enum">Qt::color0</a> sets the bitmap bits to 0 (transparent; i.e., background), and painting with <a href="qt.html#GlobalColor-enum">Qt::color1</a> sets the bits to 1 (opaque; i.e., foreground).</p>
<p><a href="qt.html#GlobalColor-enum">Qt::transparent</a> is used to indicate a transparent pixel. When painting with this value, a pixel value will be used that is appropriate for the underlying pixel format in use.</p>
<a name="the-hsv-color-model"></a>
<h3>The HSV Color Model</h3>
<p>The RGB model is hardware-oriented. Its representation is close to what most monitors show. In contrast, HSV represents color in a way more suited to the human perception of color. For example, the relationships "stronger than", "darker than", and "the opposite of" are easily expressed in HSV but are much harder to express in RGB.</p>
<p>HSV, like RGB, has three components:</p>
<ul>
<li>H, for hue, is in the range 0 to 359 if the color is chromatic (not gray), or meaningless if it is gray. It represents degrees on the color wheel familiar to most people. Red is 0 (degrees), green is 120, and blue is 240.<p><img src="images/qcolor-hue.png" alt="" /></p>
</li>
<li>S, for saturation, is in the range 0 to 255, and the bigger it is, the stronger the color is. Grayish colors have saturation near 0; very strong colors have saturation near 255.<p><img src="images/qcolor-saturation.png" alt="" /></p>
</li>
<li>V, for value, is in the range 0 to 255 and represents lightness or brightness of the color. 0 is black; 255 is as far from black as possible.<p><img src="images/qcolor-value.png" alt="" /></p>
</li>
</ul>
<p>Here are some examples: pure red is H=0, S=255, V=255; a dark red, moving slightly towards the magenta, could be H=350 (equivalent to -10), S=255, V=180; a grayish light red could have H about 0 (say 350-359 or 0-10), S about 50-100, and S=255.</p>
<p>Qt returns a hue value of -1 for achromatic colors. If you pass a hue value that is too large, Qt forces it into range. Hue 360 or 720 is treated as 0; hue 540 is treated as 180.</p>
<p>In addition to the standard HSV model, Qt provides an alpha-channel to feature <a href="#alpha-blended-drawing">alpha-blended drawing</a>.</p>
<a name="the-hsl-color-model"></a>
<h3>The HSL Color Model</h3>
<p>HSL is similar to HSV. Instead of value parameter from HSV, HSL has the lightness parameter. The lightness parameter goes from black to color and from color to white. If you go outside at the night its black or dark gray. At day its colorful but if you look in a really strong light a things they are going to white and wash out.</p>
<a name="the-cmyk-color-model"></a>
<h3>The CMYK Color Model</h3>
<p>While the RGB and HSV color models are used for display on computer monitors, the CMYK model is used in the four-color printing process of printing presses and some hard-copy devices.</p>
<p>CMYK has four components, all in the range 0-255: cyan (C), magenta (M), yellow (Y) and black (K). Cyan, magenta and yellow are called subtractive colors; the CMYK color model creates color by starting with a white surface and then subtracting color by applying the appropriate components. While combining cyan, magenta and yellow gives the color black, subtracting one or more will yield any other color. When combined in various percentages, these three colors can create the entire spectrum of colors.</p>
<p>Mixing 100 percent of cyan, magenta and yellow <i>does</i> produce black, but the result is unsatisfactory since it wastes ink, increases drying time, and gives a muddy colour when printing. For that reason, black is added in professional printing to provide a solid black tone; hence the term 'four color process'.</p>
<p>In addition to the standard CMYK model, Qt provides an alpha-channel to feature <a href="#alpha-blended-drawing">alpha-blended drawing</a>.</p>
</div>
<p><b>See also </b><a href="qpalette.html">QPalette</a>, <a href="qbrush.html">QBrush</a>, and <a href="qapplication.html#setColorSpec">QApplication::setColorSpec</a>().</p>
<!-- @@@QColor -->
<div class="types">
<h2>Member Type Documentation</h2>
<!-- $$$Spec$$$Invalid$$$Rgb$$$Hsv$$$Cmyk$$$Hsl -->
<h3 class="fn"><a name="Spec-enum"></a>enum QColor::<span class="name">Spec</span></h3>
<p>The type of color specified, either RGB, HSV, CMYK or HSL.</p>
<table class="valuelist"><tr><th class="tblConst">Constant</th><th class="tblVal">Value</th></tr>
<tr><td class="topAlign"><tt>QColor::Rgb</tt></td><td class="topAlign"><tt>1</tt></td></tr>
<tr><td class="topAlign"><tt>QColor::Hsv</tt></td><td class="topAlign"><tt>2</tt></td></tr>
<tr><td class="topAlign"><tt>QColor::Cmyk</tt></td><td class="topAlign"><tt>3</tt></td></tr>
<tr><td class="topAlign"><tt>QColor::Hsl</tt></td><td class="topAlign"><tt>4</tt></td></tr>
<tr><td class="topAlign"><tt>QColor::Invalid</tt></td><td class="topAlign"><tt>0</tt></td></tr>
</table>
<p><b>See also </b><a href="qcolor.html#spec">spec</a>() and <a href="qcolor.html#convertTo">convertTo</a>().</p>
<!-- @@@Spec -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QColor[overload1]$$$QColor -->
<h3 class="fn"><a name="QColor"></a>QColor::<span class="name">QColor</span> ()</h3>
<p>Constructs an invalid color with the RGB value (0, 0, 0). An invalid color is a color that is not properly set up for the underlying window system.</p>
<p>The alpha value of an invalid color is unspecified.</p>
<p><b>See also </b><a href="qcolor.html#isValid">isValid</a>().</p>
<!-- @@@QColor -->
<!-- $$$QColor$$$QColorintintintint -->
<h3 class="fn"><a name="QColor-2"></a>QColor::<span class="name">QColor</span> ( <span class="type">int</span> <i>r</i>, <span class="type">int</span> <i>g</i>, <span class="type">int</span> <i>b</i>, <span class="type">int</span> <i>a</i> = 255 )</h3>
<p>Constructs a color with the RGB value <i>r</i>, <i>g</i>, <i>b</i>, and the alpha-channel (transparency) value of <i>a</i>.</p>
<p>The color is left invalid if any of the arguments are invalid.</p>
<p><b>See also </b><a href="qcolor.html#setRgba">setRgba</a>() and <a href="qcolor.html#isValid">isValid</a>().</p>
<!-- @@@QColor -->
<!-- $$$QColor$$$QColorQRgb -->
<h3 class="fn"><a name="QColor-3"></a>QColor::<span class="name">QColor</span> ( <span class="type"><a href="qcolor.html#QRgb-typedef">QRgb</a></span> <i>color</i> )</h3>
<p>Constructs a color with the value <i>color</i>. The alpha component is ignored and set to solid.</p>
<p><b>See also </b><a href="qcolor.html#fromRgb">fromRgb</a>() and <a href="qcolor.html#isValid">isValid</a>().</p>
<!-- @@@QColor -->
<!-- $$$QColor$$$QColorconstQString& -->
<h3 class="fn"><a name="QColor-4"></a>QColor::<span class="name">QColor</span> ( const <span class="type"><a href="qstring.html">QString</a></span> & <i>name</i> )</h3>
<p>Constructs a named color in the same way as <a href="qcolor.html#setNamedColor">setNamedColor</a>() using the given <i>name</i>.</p>
<p>The color is left invalid if the <i>name</i> cannot be parsed.</p>
<p><b>See also </b><a href="qcolor.html#setNamedColor">setNamedColor</a>(), <a href="qcolor.html#name">name</a>(), and <a href="qcolor.html#isValid">isValid</a>().</p>
<!-- @@@QColor -->
<!-- $$$QColor$$$QColorconstchar* -->
<h3 class="fn"><a name="QColor-5"></a>QColor::<span class="name">QColor</span> ( const <span class="type">char</span> * <i>name</i> )</h3>
<p>Constructs a named color in the same way as <a href="qcolor.html#setNamedColor">setNamedColor</a>() using the given <i>name</i>.</p>
<p>The color is left invalid if the <i>name</i> cannot be parsed.</p>
<p><b>See also </b><a href="qcolor.html#setNamedColor">setNamedColor</a>(), <a href="qcolor.html#name">name</a>(), and <a href="qcolor.html#isValid">isValid</a>().</p>
<!-- @@@QColor -->
<!-- $$$QColor$$$QColorconstQColor& -->
<h3 class="fn"><a name="QColor-6"></a>QColor::<span class="name">QColor</span> ( const <span class="type">QColor</span> & <i>color</i> )</h3>
<p>Constructs a color that is a copy of <i>color</i>.</p>
<p><b>See also </b><a href="qcolor.html#isValid">isValid</a>().</p>
<!-- @@@QColor -->
<!-- $$$QColor$$$QColorQt::GlobalColor -->
<h3 class="fn"><a name="QColor-9"></a>QColor::<span class="name">QColor</span> ( <span class="type"><a href="qt.html#GlobalColor-enum">Qt::GlobalColor</a></span> <i>color</i> )</h3>
<p>This is an overloaded function.</p>
<p>Constructs a new color with a color value of <i>color</i>.</p>
<p><b>See also </b><a href="qcolor.html#isValid">isValid</a>() and <a href="qcolor.html#predefined-colors">Predefined Colors</a>.</p>
<!-- @@@QColor -->
<!-- $$$allowX11ColorNames[overload1]$$$allowX11ColorNames -->
<h3 class="fn"><a name="allowX11ColorNames"></a><span class="type">bool</span> QColor::<span class="name">allowX11ColorNames</span> ()<tt> [static]</tt></h3>
<p>Returns true if <a href="qcolor.html#setNamedColor">setNamedColor</a>() is allowed to look up colors in the X11 color database. By default, this function returns false.</p>
<p><b>Note:</b> This function is only available on the X11 platform.</p>
<p><b>See also </b><a href="qcolor.html#setAllowX11ColorNames">setAllowX11ColorNames</a>().</p>
<!-- @@@allowX11ColorNames -->
<!-- $$$alpha[overload1]$$$alpha -->
<h3 class="fn"><a name="alpha"></a><span class="type">int</span> QColor::<span class="name">alpha</span> () const</h3>
<p>Returns the alpha color component of this color.</p>
<p><b>See also </b><a href="qcolor.html#setAlpha">setAlpha</a>(), <a href="qcolor.html#alphaF">alphaF</a>(), and <a href="qcolor.html#alpha-blended-drawing">Alpha-Blended Drawing</a>.</p>
<!-- @@@alpha -->
<!-- $$$alphaF[overload1]$$$alphaF -->
<h3 class="fn"><a name="alphaF"></a><span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> QColor::<span class="name">alphaF</span> () const</h3>
<p>Returns the alpha color component of this color.</p>
<p><b>See also </b><a href="qcolor.html#setAlphaF">setAlphaF</a>(), <a href="qcolor.html#alpha">alpha</a>(), and <a href="qcolor.html#alpha-blended-drawing">Alpha-Blended Drawing</a>.</p>
<!-- @@@alphaF -->
<!-- $$$black[overload1]$$$black -->
<h3 class="fn"><a name="black"></a><span class="type">int</span> QColor::<span class="name">black</span> () const</h3>
<p>Returns the black color component of this color.</p>
<p><b>See also </b><a href="qcolor.html#blackF">blackF</a>(), <a href="qcolor.html#getCmyk">getCmyk</a>(), and <a href="qcolor.html#the-cmyk-color-model">The CMYK Color Model</a>.</p>
<!-- @@@black -->
<!-- $$$blackF[overload1]$$$blackF -->
<h3 class="fn"><a name="blackF"></a><span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> QColor::<span class="name">blackF</span> () const</h3>
<p>Returns the black color component of this color.</p>
<p><b>See also </b><a href="qcolor.html#black">black</a>(), <a href="qcolor.html#getCmykF">getCmykF</a>(), and <a href="qcolor.html#the-cmyk-color-model">The CMYK Color Model</a>.</p>
<!-- @@@blackF -->
<!-- $$$blue[overload1]$$$blue -->
<h3 class="fn"><a name="blue"></a><span class="type">int</span> QColor::<span class="name">blue</span> () const</h3>
<p>Returns the blue color component of this color.</p>
<p><b>See also </b><a href="qcolor.html#setBlue">setBlue</a>(), <a href="qcolor.html#blueF">blueF</a>(), and <a href="qcolor.html#getRgb">getRgb</a>().</p>
<!-- @@@blue -->
<!-- $$$blueF[overload1]$$$blueF -->
<h3 class="fn"><a name="blueF"></a><span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> QColor::<span class="name">blueF</span> () const</h3>
<p>Returns the blue color component of this color.</p>
<p><b>See also </b><a href="qcolor.html#setBlueF">setBlueF</a>(), <a href="qcolor.html#blue">blue</a>(), and <a href="qcolor.html#getRgbF">getRgbF</a>().</p>
<!-- @@@blueF -->
<!-- $$$colorNames[overload1]$$$colorNames -->
<h3 class="fn"><a name="colorNames"></a><span class="type"><a href="qstringlist.html">QStringList</a></span> QColor::<span class="name">colorNames</span> ()<tt> [static]</tt></h3>
<p>Returns a <a href="qstringlist.html">QStringList</a> containing the color names Qt knows about.</p>
<p><b>See also </b><a href="qcolor.html#predefined-colors">Predefined Colors</a>.</p>
<!-- @@@colorNames -->
<!-- $$$convertTo[overload1]$$$convertToSpec -->
<h3 class="fn"><a name="convertTo"></a><span class="type">QColor</span> QColor::<span class="name">convertTo</span> ( <span class="type"><a href="qcolor.html#Spec-enum">Spec</a></span> <i>colorSpec</i> ) const</h3>
<p>Creates a copy of <i>this</i> color in the format specified by <i>colorSpec</i>.</p>
<p><b>See also </b><a href="qcolor.html#spec">spec</a>(), <a href="qcolor.html#toCmyk">toCmyk</a>(), <a href="qcolor.html#toHsv">toHsv</a>(), <a href="qcolor.html#toRgb">toRgb</a>(), and <a href="qcolor.html#isValid">isValid</a>().</p>
<!-- @@@convertTo -->
<!-- $$$cyan[overload1]$$$cyan -->
<h3 class="fn"><a name="cyan"></a><span class="type">int</span> QColor::<span class="name">cyan</span> () const</h3>
<p>Returns the cyan color component of this color.</p>
<p><b>See also </b><a href="qcolor.html#cyanF">cyanF</a>(), <a href="qcolor.html#getCmyk">getCmyk</a>(), and <a href="qcolor.html#the-cmyk-color-model">The CMYK Color Model</a>.</p>
<!-- @@@cyan -->
<!-- $$$cyanF[overload1]$$$cyanF -->
<h3 class="fn"><a name="cyanF"></a><span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> QColor::<span class="name">cyanF</span> () const</h3>
<p>Returns the cyan color component of this color.</p>
<p><b>See also </b><a href="qcolor.html#cyan">cyan</a>(), <a href="qcolor.html#getCmykF">getCmykF</a>(), and <a href="qcolor.html#the-cmyk-color-model">The CMYK Color Model</a>.</p>
<!-- @@@cyanF -->
<!-- $$$darker[overload1]$$$darkerint -->
<h3 class="fn"><a name="darker"></a><span class="type">QColor</span> QColor::<span class="name">darker</span> ( <span class="type">int</span> <i>factor</i> = 200 ) const</h3>
<p>Returns a darker (or lighter) color, but does not change this object.</p>
<p>If the <i>factor</i> is greater than 100, this functions returns a darker color. Setting <i>factor</i> to 300 returns a color that has one-third the brightness. If the <i>factor</i> is less than 100, the return color is lighter, but we recommend using the <a href="qcolor.html#lighter">lighter</a>() function for this purpose. If the <i>factor</i> is 0 or negative, the return value is unspecified.</p>
<p>The function converts the current RGB color to HSV, divides the value (V) component by <i>factor</i> and converts the color back to RGB.</p>
<p>This function was introduced in Qt 4.3.</p>
<p><b>See also </b><a href="qcolor.html#lighter">lighter</a>() and <a href="qcolor.html#isValid">isValid</a>().</p>
<!-- @@@darker -->
<!-- $$$fromCmyk[overload1]$$$fromCmykintintintintint -->
<h3 class="fn"><a name="fromCmyk"></a><span class="type">QColor</span> QColor::<span class="name">fromCmyk</span> ( <span class="type">int</span> <i>c</i>, <span class="type">int</span> <i>m</i>, <span class="type">int</span> <i>y</i>, <span class="type">int</span> <i>k</i>, <span class="type">int</span> <i>a</i> = 255 )<tt> [static]</tt></h3>
<p>Static convenience function that returns a <a href="qcolor.html">QColor</a> constructed from the given CMYK color values: <i>c</i> (cyan), <i>m</i> (magenta), <i>y</i> (yellow), <i>k</i> (black), and <i>a</i> (alpha-channel, i.e. transparency).</p>
<p>All the values must be in the range 0-255.</p>
<p><b>See also </b><a href="qcolor.html#toCmyk">toCmyk</a>(), <a href="qcolor.html#fromCmykF">fromCmykF</a>(), <a href="qcolor.html#isValid">isValid</a>(), and <a href="qcolor.html#the-cmyk-color-model">The CMYK Color Model</a>.</p>
<!-- @@@fromCmyk -->
<!-- $$$fromCmykF[overload1]$$$fromCmykFqrealqrealqrealqrealqreal -->
<h3 class="fn"><a name="fromCmykF"></a><span class="type">QColor</span> QColor::<span class="name">fromCmykF</span> ( <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>c</i>, <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>m</i>, <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>y</i>, <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>k</i>, <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>a</i> = 1.0 )<tt> [static]</tt></h3>
<p>This is an overloaded function.</p>
<p>Static convenience function that returns a <a href="qcolor.html">QColor</a> constructed from the given CMYK color values: <i>c</i> (cyan), <i>m</i> (magenta), <i>y</i> (yellow), <i>k</i> (black), and <i>a</i> (alpha-channel, i.e. transparency).</p>
<p>All the values must be in the range 0.0-1.0.</p>
<p><b>See also </b><a href="qcolor.html#toCmyk">toCmyk</a>(), <a href="qcolor.html#fromCmyk">fromCmyk</a>(), <a href="qcolor.html#isValid">isValid</a>(), and <a href="qcolor.html#the-cmyk-color-model">The CMYK Color Model</a>.</p>
<!-- @@@fromCmykF -->
<!-- $$$fromHsl[overload1]$$$fromHslintintintint -->
<h3 class="fn"><a name="fromHsl"></a><span class="type">QColor</span> QColor::<span class="name">fromHsl</span> ( <span class="type">int</span> <i>h</i>, <span class="type">int</span> <i>s</i>, <span class="type">int</span> <i>l</i>, <span class="type">int</span> <i>a</i> = 255 )<tt> [static]</tt></h3>
<p>Static convenience function that returns a <a href="qcolor.html">QColor</a> constructed from the HSV color values, <i>h</i> (hue), <i>s</i> (saturation), <i>l</i> (lightness), and <i>a</i> (alpha-channel, i.e. transparency).</p>
<p>The value of <i>s</i>, <i>l</i>, and <i>a</i> must all be in the range 0-255; the value of <i>h</i> must be in the range 0-359.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also </b><a href="qcolor.html#toHsl">toHsl</a>(), <a href="qcolor.html#fromHslF">fromHslF</a>(), and <a href="qcolor.html#isValid">isValid</a>().</p>
<!-- @@@fromHsl -->
<!-- $$$fromHslF[overload1]$$$fromHslFqrealqrealqrealqreal -->
<h3 class="fn"><a name="fromHslF"></a><span class="type">QColor</span> QColor::<span class="name">fromHslF</span> ( <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>h</i>, <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>s</i>, <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>l</i>, <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>a</i> = 1.0 )<tt> [static]</tt></h3>
<p>This is an overloaded function.</p>
<p>Static convenience function that returns a <a href="qcolor.html">QColor</a> constructed from the HSV color values, <i>h</i> (hue), <i>s</i> (saturation), <i>l</i> (lightness), and <i>a</i> (alpha-channel, i.e. transparency).</p>
<p>All the values must be in the range 0.0-1.0.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also </b><a href="qcolor.html#toHsl">toHsl</a>(), <a href="qcolor.html#fromHsl">fromHsl</a>(), and <a href="qcolor.html#isValid">isValid</a>().</p>
<!-- @@@fromHslF -->
<!-- $$$fromHsv[overload1]$$$fromHsvintintintint -->
<h3 class="fn"><a name="fromHsv"></a><span class="type">QColor</span> QColor::<span class="name">fromHsv</span> ( <span class="type">int</span> <i>h</i>, <span class="type">int</span> <i>s</i>, <span class="type">int</span> <i>v</i>, <span class="type">int</span> <i>a</i> = 255 )<tt> [static]</tt></h3>
<p>Static convenience function that returns a <a href="qcolor.html">QColor</a> constructed from the HSV color values, <i>h</i> (hue), <i>s</i> (saturation), <i>v</i> (value), and <i>a</i> (alpha-channel, i.e. transparency).</p>
<p>The value of <i>s</i>, <i>v</i>, and <i>a</i> must all be in the range 0-255; the value of <i>h</i> must be in the range 0-359.</p>
<p><b>See also </b><a href="qcolor.html#toHsv">toHsv</a>(), <a href="qcolor.html#fromHsvF">fromHsvF</a>(), <a href="qcolor.html#isValid">isValid</a>(), and <a href="qcolor.html#the-hsv-color-model">The HSV Color Model</a>.</p>
<!-- @@@fromHsv -->
<!-- $$$fromHsvF[overload1]$$$fromHsvFqrealqrealqrealqreal -->
<h3 class="fn"><a name="fromHsvF"></a><span class="type">QColor</span> QColor::<span class="name">fromHsvF</span> ( <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>h</i>, <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>s</i>, <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>v</i>, <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>a</i> = 1.0 )<tt> [static]</tt></h3>
<p>This is an overloaded function.</p>
<p>Static convenience function that returns a <a href="qcolor.html">QColor</a> constructed from the HSV color values, <i>h</i> (hue), <i>s</i> (saturation), <i>v</i> (value), and <i>a</i> (alpha-channel, i.e. transparency).</p>
<p>All the values must be in the range 0.0-1.0.</p>
<p><b>See also </b><a href="qcolor.html#toHsv">toHsv</a>(), <a href="qcolor.html#fromHsv">fromHsv</a>(), <a href="qcolor.html#isValid">isValid</a>(), and <a href="qcolor.html#the-hsv-color-model">The HSV Color Model</a>.</p>
<!-- @@@fromHsvF -->
<!-- $$$fromRgb[overload1]$$$fromRgbQRgb -->
<h3 class="fn"><a name="fromRgb"></a><span class="type">QColor</span> QColor::<span class="name">fromRgb</span> ( <span class="type"><a href="qcolor.html#QRgb-typedef">QRgb</a></span> <i>rgb</i> )<tt> [static]</tt></h3>
<p>Static convenience function that returns a <a href="qcolor.html">QColor</a> constructed from the given <a href="qcolor.html#QRgb-typedef">QRgb</a> value <i>rgb</i>.</p>
<p>The alpha component of <i>rgb</i> is ignored (i.e. it is automatically set to 255), use the <a href="qcolor.html#fromRgba">fromRgba</a>() function to include the alpha-channel specified by the given <a href="qcolor.html#QRgb-typedef">QRgb</a> value.</p>
<p><b>See also </b><a href="qcolor.html#fromRgba">fromRgba</a>(), <a href="qcolor.html#fromRgbF">fromRgbF</a>(), <a href="qcolor.html#toRgb">toRgb</a>(), and <a href="qcolor.html#isValid">isValid</a>().</p>
<!-- @@@fromRgb -->
<!-- $$$fromRgb$$$fromRgbintintintint -->
<h3 class="fn"><a name="fromRgb-2"></a><span class="type">QColor</span> QColor::<span class="name">fromRgb</span> ( <span class="type">int</span> <i>r</i>, <span class="type">int</span> <i>g</i>, <span class="type">int</span> <i>b</i>, <span class="type">int</span> <i>a</i> = 255 )<tt> [static]</tt></h3>
<p>Static convenience function that returns a <a href="qcolor.html">QColor</a> constructed from the RGB color values, <i>r</i> (red), <i>g</i> (green), <i>b</i> (blue), and <i>a</i> (alpha-channel, i.e. transparency).</p>
<p>All the values must be in the range 0-255.</p>
<p><b>See also </b><a href="qcolor.html#toRgb">toRgb</a>(), <a href="qcolor.html#fromRgbF">fromRgbF</a>(), and <a href="qcolor.html#isValid">isValid</a>().</p>
<!-- @@@fromRgb -->
<!-- $$$fromRgbF[overload1]$$$fromRgbFqrealqrealqrealqreal -->
<h3 class="fn"><a name="fromRgbF"></a><span class="type">QColor</span> QColor::<span class="name">fromRgbF</span> ( <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>r</i>, <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>g</i>, <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>b</i>, <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>a</i> = 1.0 )<tt> [static]</tt></h3>
<p>Static convenience function that returns a <a href="qcolor.html">QColor</a> constructed from the RGB color values, <i>r</i> (red), <i>g</i> (green), <i>b</i> (blue), and <i>a</i> (alpha-channel, i.e. transparency).</p>
<p>All the values must be in the range 0.0-1.0.</p>
<p><b>See also </b><a href="qcolor.html#fromRgb">fromRgb</a>(), <a href="qcolor.html#toRgb">toRgb</a>(), and <a href="qcolor.html#isValid">isValid</a>().</p>
<!-- @@@fromRgbF -->
<!-- $$$fromRgba[overload1]$$$fromRgbaQRgb -->
<h3 class="fn"><a name="fromRgba"></a><span class="type">QColor</span> QColor::<span class="name">fromRgba</span> ( <span class="type"><a href="qcolor.html#QRgb-typedef">QRgb</a></span> <i>rgba</i> )<tt> [static]</tt></h3>
<p>Static convenience function that returns a <a href="qcolor.html">QColor</a> constructed from the given <a href="qcolor.html#QRgb-typedef">QRgb</a> value <i>rgba</i>.</p>
<p>Unlike the <a href="qcolor.html#fromRgb">fromRgb</a>() function, the alpha-channel specified by the given <a href="qcolor.html#QRgb-typedef">QRgb</a> value is included.</p>
<p><b>See also </b><a href="qcolor.html#fromRgb">fromRgb</a>() and <a href="qcolor.html#isValid">isValid</a>().</p>
<!-- @@@fromRgba -->
<!-- $$$getCmyk[overload1]$$$getCmykint*int*int*int*int* -->
<h3 class="fn"><a name="getCmyk"></a><span class="type">void</span> QColor::<span class="name">getCmyk</span> ( <span class="type">int</span> * <i>c</i>, <span class="type">int</span> * <i>m</i>, <span class="type">int</span> * <i>y</i>, <span class="type">int</span> * <i>k</i>, <span class="type">int</span> * <i>a</i> = 0 )</h3>
<p>Sets the contents pointed to by <i>c</i>, <i>m</i>, <i>y</i>, <i>k</i>, and <i>a</i>, to the cyan, magenta, yellow, black, and alpha-channel (transparency) components of the color's CMYK value.</p>
<p>These components can be retrieved individually using the <a href="qcolor.html#cyan">cyan</a>(), <a href="qcolor.html#magenta">magenta</a>(), <a href="qcolor.html#yellow">yellow</a>(), <a href="qcolor.html#black">black</a>() and <a href="qcolor.html#alpha">alpha</a>() functions.</p>
<p><b>See also </b><a href="qcolor.html#setCmyk">setCmyk</a>() and <a href="qcolor.html#the-cmyk-color-model">The CMYK Color Model</a>.</p>
<!-- @@@getCmyk -->
<!-- $$$getCmykF[overload1]$$$getCmykFqreal*qreal*qreal*qreal*qreal* -->
<h3 class="fn"><a name="getCmykF"></a><span class="type">void</span> QColor::<span class="name">getCmykF</span> ( <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> * <i>c</i>, <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> * <i>m</i>, <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> * <i>y</i>, <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> * <i>k</i>, <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> * <i>a</i> = 0 )</h3>
<p>Sets the contents pointed to by <i>c</i>, <i>m</i>, <i>y</i>, <i>k</i>, and <i>a</i>, to the cyan, magenta, yellow, black, and alpha-channel (transparency) components of the color's CMYK value.</p>
<p>These components can be retrieved individually using the <a href="qcolor.html#cyanF">cyanF</a>(), <a href="qcolor.html#magentaF">magentaF</a>(), <a href="qcolor.html#yellowF">yellowF</a>(), <a href="qcolor.html#blackF">blackF</a>() and <a href="qcolor.html#alphaF">alphaF</a>() functions.</p>
<p><b>See also </b><a href="qcolor.html#setCmykF">setCmykF</a>() and <a href="qcolor.html#the-cmyk-color-model">The CMYK Color Model</a>.</p>
<!-- @@@getCmykF -->
<!-- $$$getHsl[overload1]$$$getHslint*int*int*int* -->
<h3 class="fn"><a name="getHsl"></a><span class="type">void</span> QColor::<span class="name">getHsl</span> ( <span class="type">int</span> * <i>h</i>, <span class="type">int</span> * <i>s</i>, <span class="type">int</span> * <i>l</i>, <span class="type">int</span> * <i>a</i> = 0 ) const</h3>
<p>Sets the contents pointed to by <i>h</i>, <i>s</i>, <i>l</i>, and <i>a</i>, to the hue, saturation, lightness, and alpha-channel (transparency) components of the color's HSL value.</p>
<p>These components can be retrieved individually using the hueHsl(), saturationHsl(), <a href="qcolor.html#lightness">lightness</a>() and <a href="qcolor.html#alpha">alpha</a>() functions.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also </b><a href="qcolor.html#setHsl">setHsl</a>().</p>
<!-- @@@getHsl -->
<!-- $$$getHslF[overload1]$$$getHslFqreal*qreal*qreal*qreal* -->
<h3 class="fn"><a name="getHslF"></a><span class="type">void</span> QColor::<span class="name">getHslF</span> ( <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> * <i>h</i>, <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> * <i>s</i>, <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> * <i>l</i>, <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> * <i>a</i> = 0 ) const</h3>
<p>Sets the contents pointed to by <i>h</i>, <i>s</i>, <i>l</i>, and <i>a</i>, to the hue, saturation, lightness, and alpha-channel (transparency) components of the color's HSL value.</p>
<p>These components can be retrieved individually using the hueHslF(), saturationHslF(), <a href="qcolor.html#lightnessF">lightnessF</a>() and <a href="qcolor.html#alphaF">alphaF</a>() functions.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also </b><a href="qcolor.html#setHsl">setHsl</a>().</p>
<!-- @@@getHslF -->
<!-- $$$getHsv[overload1]$$$getHsvint*int*int*int* -->
<h3 class="fn"><a name="getHsv"></a><span class="type">void</span> QColor::<span class="name">getHsv</span> ( <span class="type">int</span> * <i>h</i>, <span class="type">int</span> * <i>s</i>, <span class="type">int</span> * <i>v</i>, <span class="type">int</span> * <i>a</i> = 0 ) const</h3>
<p>Sets the contents pointed to by <i>h</i>, <i>s</i>, <i>v</i>, and <i>a</i>, to the hue, saturation, value, and alpha-channel (transparency) components of the color's HSV value.</p>
<p>These components can be retrieved individually using the <a href="qcolor.html#hue">hue</a>(), <a href="qcolor.html#saturation">saturation</a>(), <a href="qcolor.html#value">value</a>() and <a href="qcolor.html#alpha">alpha</a>() functions.</p>
<p><b>See also </b><a href="qcolor.html#setHsv">setHsv</a>() and <a href="qcolor.html#the-hsv-color-model">The HSV Color Model</a>.</p>
<!-- @@@getHsv -->
<!-- $$$getHsvF[overload1]$$$getHsvFqreal*qreal*qreal*qreal* -->
<h3 class="fn"><a name="getHsvF"></a><span class="type">void</span> QColor::<span class="name">getHsvF</span> ( <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> * <i>h</i>, <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> * <i>s</i>, <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> * <i>v</i>, <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> * <i>a</i> = 0 ) const</h3>
<p>Sets the contents pointed to by <i>h</i>, <i>s</i>, <i>v</i>, and <i>a</i>, to the hue, saturation, value, and alpha-channel (transparency) components of the color's HSV value.</p>
<p>These components can be retrieved individually using the <a href="qcolor.html#hueF">hueF</a>(), <a href="qcolor.html#saturationF">saturationF</a>(), <a href="qcolor.html#valueF">valueF</a>() and <a href="qcolor.html#alphaF">alphaF</a>() functions.</p>
<p><b>See also </b><a href="qcolor.html#setHsv">setHsv</a>() and <a href="qcolor.html#the-hsv-color-model">The HSV Color Model</a>.</p>
<!-- @@@getHsvF -->
<!-- $$$getRgb[overload1]$$$getRgbint*int*int*int* -->
<h3 class="fn"><a name="getRgb"></a><span class="type">void</span> QColor::<span class="name">getRgb</span> ( <span class="type">int</span> * <i>r</i>, <span class="type">int</span> * <i>g</i>, <span class="type">int</span> * <i>b</i>, <span class="type">int</span> * <i>a</i> = 0 ) const</h3>
<p>Sets the contents pointed to by <i>r</i>, <i>g</i>, <i>b</i>, and <i>a</i>, to the red, green, blue, and alpha-channel (transparency) components of the color's RGB value.</p>
<p>These components can be retrieved individually using the <a href="qcolor.html#red">red</a>(), <a href="qcolor.html#green">green</a>(), <a href="qcolor.html#blue">blue</a>() and <a href="qcolor.html#alpha">alpha</a>() functions.</p>
<p><b>See also </b><a href="qcolor.html#rgb">rgb</a>() and <a href="qcolor.html#setRgb">setRgb</a>().</p>
<!-- @@@getRgb -->
<!-- $$$getRgbF[overload1]$$$getRgbFqreal*qreal*qreal*qreal* -->
<h3 class="fn"><a name="getRgbF"></a><span class="type">void</span> QColor::<span class="name">getRgbF</span> ( <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> * <i>r</i>, <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> * <i>g</i>, <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> * <i>b</i>, <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> * <i>a</i> = 0 ) const</h3>
<p>Sets the contents pointed to by <i>r</i>, <i>g</i>, <i>b</i>, and <i>a</i>, to the red, green, blue, and alpha-channel (transparency) components of the color's RGB value.</p>
<p>These components can be retrieved individually using the <a href="qcolor.html#redF">redF</a>(), <a href="qcolor.html#greenF">greenF</a>(), <a href="qcolor.html#blueF">blueF</a>() and <a href="qcolor.html#alphaF">alphaF</a>() functions.</p>
<p><b>See also </b><a href="qcolor.html#rgb">rgb</a>() and <a href="qcolor.html#setRgb">setRgb</a>().</p>
<!-- @@@getRgbF -->
<!-- $$$green[overload1]$$$green -->
<h3 class="fn"><a name="green"></a><span class="type">int</span> QColor::<span class="name">green</span> () const</h3>
<p>Returns the green color component of this color.</p>
<p><b>See also </b><a href="qcolor.html#setGreen">setGreen</a>(), <a href="qcolor.html#greenF">greenF</a>(), and <a href="qcolor.html#getRgb">getRgb</a>().</p>
<!-- @@@green -->
<!-- $$$greenF[overload1]$$$greenF -->
<h3 class="fn"><a name="greenF"></a><span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> QColor::<span class="name">greenF</span> () const</h3>
<p>Returns the green color component of this color.</p>
<p><b>See also </b><a href="qcolor.html#setGreenF">setGreenF</a>(), <a href="qcolor.html#green">green</a>(), and <a href="qcolor.html#getRgbF">getRgbF</a>().</p>
<!-- @@@greenF -->
<!-- $$$hslHue[overload1]$$$hslHue -->
<h3 class="fn"><a name="hslHue"></a><span class="type">int</span> QColor::<span class="name">hslHue</span> () const</h3>
<p>Returns the hue color component of this color.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also </b><a href="qcolor.html#getHslF">getHslF</a>() and <a href="qcolor.html#getHsl">getHsl</a>().</p>
<!-- @@@hslHue -->
<!-- $$$hslHueF[overload1]$$$hslHueF -->
<h3 class="fn"><a name="hslHueF"></a><span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> QColor::<span class="name">hslHueF</span> () const</h3>
<p>Returns the hue color component of this color.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also </b><a href="qcolor.html#hue">hue</a>() and <a href="qcolor.html#getHslF">getHslF</a>().</p>
<!-- @@@hslHueF -->
<!-- $$$hslSaturation[overload1]$$$hslSaturation -->
<h3 class="fn"><a name="hslSaturation"></a><span class="type">int</span> QColor::<span class="name">hslSaturation</span> () const</h3>
<p>Returns the saturation color component of this color.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also </b><a href="qcolor.html#saturationF">saturationF</a>(), <a href="qcolor.html#getHsv">getHsv</a>(), and <a href="qcolor.html#the-hsv-color-model">The HSV Color Model</a>.</p>
<!-- @@@hslSaturation -->
<!-- $$$hslSaturationF[overload1]$$$hslSaturationF -->
<h3 class="fn"><a name="hslSaturationF"></a><span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> QColor::<span class="name">hslSaturationF</span> () const</h3>
<p>Returns the saturation color component of this color.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also </b><a href="qcolor.html#saturationF">saturationF</a>() and <a href="qcolor.html#getHslF">getHslF</a>().</p>
<!-- @@@hslSaturationF -->
<!-- $$$hsvHue[overload1]$$$hsvHue -->
<h3 class="fn"><a name="hsvHue"></a><span class="type">int</span> QColor::<span class="name">hsvHue</span> () const</h3>
<p>Returns the hue color component of this color.</p>
<p><b>See also </b><a href="qcolor.html#hueF">hueF</a>(), <a href="qcolor.html#getHsv">getHsv</a>(), and <a href="qcolor.html#the-hsv-color-model">The HSV Color Model</a>.</p>
<!-- @@@hsvHue -->
<!-- $$$hsvHueF[overload1]$$$hsvHueF -->
<h3 class="fn"><a name="hsvHueF"></a><span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> QColor::<span class="name">hsvHueF</span> () const</h3>
<p>Returns the hue color component of this color.</p>
<p><b>See also </b><a href="qcolor.html#hue">hue</a>(), <a href="qcolor.html#getHsvF">getHsvF</a>(), and <a href="qcolor.html#the-hsv-color-model">The HSV Color Model</a>.</p>
<!-- @@@hsvHueF -->
<!-- $$$hsvSaturation[overload1]$$$hsvSaturation -->
<h3 class="fn"><a name="hsvSaturation"></a><span class="type">int</span> QColor::<span class="name">hsvSaturation</span> () const</h3>
<p>Returns the saturation color component of this color.</p>
<p><b>See also </b><a href="qcolor.html#saturationF">saturationF</a>(), <a href="qcolor.html#getHsv">getHsv</a>(), and <a href="qcolor.html#the-hsv-color-model">The HSV Color Model</a>.</p>
<!-- @@@hsvSaturation -->
<!-- $$$hsvSaturationF[overload1]$$$hsvSaturationF -->
<h3 class="fn"><a name="hsvSaturationF"></a><span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> QColor::<span class="name">hsvSaturationF</span> () const</h3>
<p>Returns the saturation color component of this color.</p>
<p><b>See also </b><a href="qcolor.html#saturation">saturation</a>(), <a href="qcolor.html#getHsvF">getHsvF</a>(), and <a href="qcolor.html#the-hsv-color-model">The HSV Color Model</a>.</p>
<!-- @@@hsvSaturationF -->
<!-- $$$hue[overload1]$$$hue -->
<h3 class="fn"><a name="hue"></a><span class="type">int</span> QColor::<span class="name">hue</span> () const</h3>
<p>Returns the hue color component of this color.</p>
<p>The color is implicitly converted to HSV.</p>
<p><b>See also </b><a href="qcolor.html#hsvHue">hsvHue</a>(), <a href="qcolor.html#hueF">hueF</a>(), <a href="qcolor.html#getHsv">getHsv</a>(), and <a href="qcolor.html#the-hsv-color-model">The HSV Color Model</a>.</p>
<!-- @@@hue -->
<!-- $$$hueF[overload1]$$$hueF -->
<h3 class="fn"><a name="hueF"></a><span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> QColor::<span class="name">hueF</span> () const</h3>
<p>Returns the hue color component of this color.</p>
<p>The color is implicitly converted to HSV.</p>
<p><b>See also </b><a href="qcolor.html#hsvHueF">hsvHueF</a>(), <a href="qcolor.html#hue">hue</a>(), <a href="qcolor.html#getHsvF">getHsvF</a>(), and <a href="qcolor.html#the-hsv-color-model">The HSV Color Model</a>.</p>
<!-- @@@hueF -->
<!-- $$$isValid[overload1]$$$isValid -->
<h3 class="fn"><a name="isValid"></a><span class="type">bool</span> QColor::<span class="name">isValid</span> () const</h3>
<p>Returns true if the color is valid; otherwise returns false.</p>
<!-- @@@isValid -->
<!-- $$$isValidColor[overload1]$$$isValidColorconstQString& -->
<h3 class="fn"><a name="isValidColor"></a><span class="type">bool</span> QColor::<span class="name">isValidColor</span> ( const <span class="type"><a href="qstring.html">QString</a></span> & <i>name</i> )<tt> [static]</tt></h3>
<p>Returns true if the <i>name</i> is a valid color name and can be used to construct a valid <a href="qcolor.html">QColor</a> object, otherwise returns false.</p>
<p>It uses the same algorithm used in <a href="qcolor.html#setNamedColor">setNamedColor</a>().</p>
<p>This function was introduced in Qt 4.7.</p>
<p><b>See also </b><a href="qcolor.html#setNamedColor">setNamedColor</a>().</p>
<!-- @@@isValidColor -->
<!-- $$$lighter[overload1]$$$lighterint -->
<h3 class="fn"><a name="lighter"></a><span class="type">QColor</span> QColor::<span class="name">lighter</span> ( <span class="type">int</span> <i>factor</i> = 150 ) const</h3>
<p>Returns a lighter (or darker) color, but does not change this object.</p>
<p>If the <i>factor</i> is greater than 100, this functions returns a lighter color. Setting <i>factor</i> to 150 returns a color that is 50% brighter. If the <i>factor</i> is less than 100, the return color is darker, but we recommend using the <a href="qcolor.html#darker">darker</a>() function for this purpose. If the <i>factor</i> is 0 or negative, the return value is unspecified.</p>
<p>The function converts the current RGB color to HSV, multiplies the value (V) component by <i>factor</i> and converts the color back to RGB.</p>
<p>This function was introduced in Qt 4.3.</p>
<p><b>See also </b><a href="qcolor.html#darker">darker</a>() and <a href="qcolor.html#isValid">isValid</a>().</p>
<!-- @@@lighter -->
<!-- $$$lightness[overload1]$$$lightness -->
<h3 class="fn"><a name="lightness"></a><span class="type">int</span> QColor::<span class="name">lightness</span> () const</h3>
<p>Returns the lightness color component of this color.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also </b><a href="qcolor.html#lightnessF">lightnessF</a>() and <a href="qcolor.html#getHsl">getHsl</a>().</p>
<!-- @@@lightness -->
<!-- $$$lightnessF[overload1]$$$lightnessF -->
<h3 class="fn"><a name="lightnessF"></a><span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> QColor::<span class="name">lightnessF</span> () const</h3>
<p>Returns the lightness color component of this color.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also </b><a href="qcolor.html#value">value</a>() and <a href="qcolor.html#getHslF">getHslF</a>().</p>
<!-- @@@lightnessF -->
<!-- $$$magenta[overload1]$$$magenta -->
<h3 class="fn"><a name="magenta"></a><span class="type">int</span> QColor::<span class="name">magenta</span> () const</h3>
<p>Returns the magenta color component of this color.</p>
<p><b>See also </b><a href="qcolor.html#magentaF">magentaF</a>(), <a href="qcolor.html#getCmyk">getCmyk</a>(), and <a href="qcolor.html#the-cmyk-color-model">The CMYK Color Model</a>.</p>
<!-- @@@magenta -->
<!-- $$$magentaF[overload1]$$$magentaF -->
<h3 class="fn"><a name="magentaF"></a><span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> QColor::<span class="name">magentaF</span> () const</h3>
<p>Returns the magenta color component of this color.</p>
<p><b>See also </b><a href="qcolor.html#magenta">magenta</a>(), <a href="qcolor.html#getCmykF">getCmykF</a>(), and <a href="qcolor.html#the-cmyk-color-model">The CMYK Color Model</a>.</p>
<!-- @@@magentaF -->
<!-- $$$name[overload1]$$$name -->
<h3 class="fn"><a name="name"></a><span class="type"><a href="qstring.html">QString</a></span> QColor::<span class="name">name</span> () const</h3>
<p>Returns the name of the color in the format "#RRGGBB"; i.e. a "#" character followed by three two-digit hexadecimal numbers.</p>
<p><b>See also </b><a href="qcolor.html#setNamedColor">setNamedColor</a>().</p>
<!-- @@@name -->
<!-- $$$red[overload1]$$$red -->
<h3 class="fn"><a name="red"></a><span class="type">int</span> QColor::<span class="name">red</span> () const</h3>
<p>Returns the red color component of this color.</p>
<p><b>See also </b><a href="qcolor.html#setRed">setRed</a>(), <a href="qcolor.html#redF">redF</a>(), and <a href="qcolor.html#getRgb">getRgb</a>().</p>
<!-- @@@red -->
<!-- $$$redF[overload1]$$$redF -->
<h3 class="fn"><a name="redF"></a><span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> QColor::<span class="name">redF</span> () const</h3>
<p>Returns the red color component of this color.</p>
<p><b>See also </b><a href="qcolor.html#setRedF">setRedF</a>(), <a href="qcolor.html#red">red</a>(), and <a href="qcolor.html#getRgbF">getRgbF</a>().</p>
<!-- @@@redF -->
<!-- $$$rgb[overload1]$$$rgb -->
<h3 class="fn"><a name="rgb"></a><span class="type"><a href="qcolor.html#QRgb-typedef">QRgb</a></span> QColor::<span class="name">rgb</span> () const</h3>
<p>Returns the RGB value of the color. The alpha value is opaque.</p>
<p><b>See also </b><a href="qcolor.html#setRgb">setRgb</a>(), <a href="qcolor.html#getRgb">getRgb</a>(), and <a href="qcolor.html#rgba">rgba</a>().</p>
<!-- @@@rgb -->
<!-- $$$rgba[overload1]$$$rgba -->
<h3 class="fn"><a name="rgba"></a><span class="type"><a href="qcolor.html#QRgb-typedef">QRgb</a></span> QColor::<span class="name">rgba</span> () const</h3>
<p>Returns the RGB value of the color, including its alpha.</p>
<p>For an invalid color, the alpha value of the returned color is unspecified.</p>
<p><b>See also </b><a href="qcolor.html#setRgba">setRgba</a>() and <a href="qcolor.html#rgb">rgb</a>().</p>
<!-- @@@rgba -->
<!-- $$$saturation[overload1]$$$saturation -->
<h3 class="fn"><a name="saturation"></a><span class="type">int</span> QColor::<span class="name">saturation</span> () const</h3>
<p>Returns the saturation color component of this color.</p>
<p>The color is implicitly converted to HSV.</p>
<p><b>See also </b><a href="qcolor.html#hsvSaturation">hsvSaturation</a>(), <a href="qcolor.html#saturationF">saturationF</a>(), <a href="qcolor.html#getHsv">getHsv</a>(), and <a href="qcolor.html#the-hsv-color-model">The HSV Color Model</a>.</p>
<!-- @@@saturation -->
<!-- $$$saturationF[overload1]$$$saturationF -->
<h3 class="fn"><a name="saturationF"></a><span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> QColor::<span class="name">saturationF</span> () const</h3>
<p>Returns the saturation color component of this color.</p>
<p>The color is implicitly converted to HSV.</p>
<p><b>See also </b><a href="qcolor.html#hsvSaturationF">hsvSaturationF</a>(), <a href="qcolor.html#saturation">saturation</a>(), <a href="qcolor.html#getHsvF">getHsvF</a>(), and <a href="qcolor.html#the-hsv-color-model">The HSV Color Model</a>.</p>
<!-- @@@saturationF -->
<!-- $$$setAllowX11ColorNames[overload1]$$$setAllowX11ColorNamesbool -->
<h3 class="fn"><a name="setAllowX11ColorNames"></a><span class="type">void</span> QColor::<span class="name">setAllowX11ColorNames</span> ( <span class="type">bool</span> <i>enabled</i> )<tt> [static]</tt></h3>
<p>Allow <a href="qcolor.html#setNamedColor">setNamedColor</a>() to look up colors in the X11 color database if <i>enabled</i>. By default, <a href="qcolor.html#setNamedColor">setNamedColor</a>() does <i>not</i> look up colors in the X11 color database.</p>
<p><b>Note:</b> This function is only available on the X11 platform.</p>
<p><b>See also </b><a href="qcolor.html#setNamedColor">setNamedColor</a>() and <a href="qcolor.html#allowX11ColorNames">allowX11ColorNames</a>().</p>
<!-- @@@setAllowX11ColorNames -->
<!-- $$$setAlpha[overload1]$$$setAlphaint -->
<h3 class="fn"><a name="setAlpha"></a><span class="type">void</span> QColor::<span class="name">setAlpha</span> ( <span class="type">int</span> <i>alpha</i> )</h3>
<p>Sets the alpha of this color to <i>alpha</i>. Integer alpha is specified in the range 0-255.</p>
<p><b>See also </b><a href="qcolor.html#alpha">alpha</a>(), <a href="qcolor.html#alphaF">alphaF</a>(), and <a href="qcolor.html#alpha-blended-drawing">Alpha-Blended Drawing</a>.</p>
<!-- @@@setAlpha -->
<!-- $$$setAlphaF[overload1]$$$setAlphaFqreal -->
<h3 class="fn"><a name="setAlphaF"></a><span class="type">void</span> QColor::<span class="name">setAlphaF</span> ( <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>alpha</i> )</h3>
<p>Sets the alpha of this color to <i>alpha</i>. qreal alpha is specified in the range 0.0-1.0.</p>
<p><b>See also </b><a href="qcolor.html#alphaF">alphaF</a>(), <a href="qcolor.html#alpha">alpha</a>(), and <a href="qcolor.html#alpha-blended-drawing">Alpha-Blended Drawing</a>.</p>
<!-- @@@setAlphaF -->
<!-- $$$setBlue[overload1]$$$setBlueint -->
<h3 class="fn"><a name="setBlue"></a><span class="type">void</span> QColor::<span class="name">setBlue</span> ( <span class="type">int</span> <i>blue</i> )</h3>
<p>Sets the blue color component of this color to <i>blue</i>. Integer components are specified in the range 0-255.</p>
<p><b>See also </b><a href="qcolor.html#blue">blue</a>(), <a href="qcolor.html#blueF">blueF</a>(), and <a href="qcolor.html#setRgb">setRgb</a>().</p>
<!-- @@@setBlue -->
<!-- $$$setBlueF[overload1]$$$setBlueFqreal -->
<h3 class="fn"><a name="setBlueF"></a><span class="type">void</span> QColor::<span class="name">setBlueF</span> ( <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>blue</i> )</h3>
<p>Sets the blue color component of this color to <i>blue</i>. Float components are specified in the range 0.0-1.0.</p>
<p><b>See also </b><a href="qcolor.html#blueF">blueF</a>(), <a href="qcolor.html#blue">blue</a>(), and <a href="qcolor.html#setRgbF">setRgbF</a>().</p>
<!-- @@@setBlueF -->
<!-- $$$setCmyk[overload1]$$$setCmykintintintintint -->
<h3 class="fn"><a name="setCmyk"></a><span class="type">void</span> QColor::<span class="name">setCmyk</span> ( <span class="type">int</span> <i>c</i>, <span class="type">int</span> <i>m</i>, <span class="type">int</span> <i>y</i>, <span class="type">int</span> <i>k</i>, <span class="type">int</span> <i>a</i> = 255 )</h3>
<p>Sets the color to CMYK values, <i>c</i> (cyan), <i>m</i> (magenta), <i>y</i> (yellow), <i>k</i> (black), and <i>a</i> (alpha-channel, i.e. transparency).</p>
<p>All the values must be in the range 0-255.</p>
<p><b>See also </b><a href="qcolor.html#getCmyk">getCmyk</a>(), <a href="qcolor.html#setCmykF">setCmykF</a>(), and <a href="qcolor.html#the-cmyk-color-model">The CMYK Color Model</a>.</p>
<!-- @@@setCmyk -->
<!-- $$$setCmykF[overload1]$$$setCmykFqrealqrealqrealqrealqreal -->
<h3 class="fn"><a name="setCmykF"></a><span class="type">void</span> QColor::<span class="name">setCmykF</span> ( <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>c</i>, <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>m</i>, <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>y</i>, <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>k</i>, <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>a</i> = 1.0 )</h3>
<p>This is an overloaded function.</p>
<p>Sets the color to CMYK values, <i>c</i> (cyan), <i>m</i> (magenta), <i>y</i> (yellow), <i>k</i> (black), and <i>a</i> (alpha-channel, i.e. transparency).</p>
<p>All the values must be in the range 0.0-1.0.</p>
<p><b>See also </b><a href="qcolor.html#getCmykF">getCmykF</a>(), <a href="qcolor.html#setCmyk">setCmyk</a>(), and <a href="qcolor.html#the-cmyk-color-model">The CMYK Color Model</a>.</p>
<!-- @@@setCmykF -->
<!-- $$$setGreen[overload1]$$$setGreenint -->
<h3 class="fn"><a name="setGreen"></a><span class="type">void</span> QColor::<span class="name">setGreen</span> ( <span class="type">int</span> <i>green</i> )</h3>
<p>Sets the green color component of this color to <i>green</i>. Integer components are specified in the range 0-255.</p>
<p><b>See also </b><a href="qcolor.html#green">green</a>(), <a href="qcolor.html#greenF">greenF</a>(), and <a href="qcolor.html#setRgb">setRgb</a>().</p>
<!-- @@@setGreen -->
<!-- $$$setGreenF[overload1]$$$setGreenFqreal -->
<h3 class="fn"><a name="setGreenF"></a><span class="type">void</span> QColor::<span class="name">setGreenF</span> ( <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>green</i> )</h3>
<p>Sets the green color component of this color to <i>green</i>. Float components are specified in the range 0.0-1.0.</p>
<p><b>See also </b><a href="qcolor.html#greenF">greenF</a>(), <a href="qcolor.html#green">green</a>(), and <a href="qcolor.html#setRgbF">setRgbF</a>().</p>
<!-- @@@setGreenF -->
<!-- $$$setHsl[overload1]$$$setHslintintintint -->
<h3 class="fn"><a name="setHsl"></a><span class="type">void</span> QColor::<span class="name">setHsl</span> ( <span class="type">int</span> <i>h</i>, <span class="type">int</span> <i>s</i>, <span class="type">int</span> <i>l</i>, <span class="type">int</span> <i>a</i> = 255 )</h3>
<p>Sets a HSL color value; <i>h</i> is the hue, <i>s</i> is the saturation, <i>l</i> is the lightness and <i>a</i> is the alpha component of the HSL color.</p>
<p>The saturation, value and alpha-channel values must be in the range 0-255, and the hue value must be greater than -1.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also </b><a href="qcolor.html#getHsl">getHsl</a>() and <a href="qcolor.html#setHslF">setHslF</a>().</p>
<!-- @@@setHsl -->
<!-- $$$setHslF[overload1]$$$setHslFqrealqrealqrealqreal -->
<h3 class="fn"><a name="setHslF"></a><span class="type">void</span> QColor::<span class="name">setHslF</span> ( <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>h</i>, <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>s</i>, <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>l</i>, <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>a</i> = 1.0 )</h3>
<p>Sets a HSL color lightness; <i>h</i> is the hue, <i>s</i> is the saturation, <i>l</i> is the lightness and <i>a</i> is the alpha component of the HSL color.</p>
<p>All the values must be in the range 0.0-1.0.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also </b><a href="qcolor.html#getHslF">getHslF</a>() and <a href="qcolor.html#setHsl">setHsl</a>().</p>
<!-- @@@setHslF -->
<!-- $$$setHsv[overload1]$$$setHsvintintintint -->
<h3 class="fn"><a name="setHsv"></a><span class="type">void</span> QColor::<span class="name">setHsv</span> ( <span class="type">int</span> <i>h</i>, <span class="type">int</span> <i>s</i>, <span class="type">int</span> <i>v</i>, <span class="type">int</span> <i>a</i> = 255 )</h3>
<p>Sets a HSV color value; <i>h</i> is the hue, <i>s</i> is the saturation, <i>v</i> is the value and <i>a</i> is the alpha component of the HSV color.</p>
<p>The saturation, value and alpha-channel values must be in the range 0-255, and the hue value must be greater than -1.</p>
<p><b>See also </b><a href="qcolor-qt3.html#hsv" class="compat">hsv</a>(), <a href="qcolor.html#getHsv">getHsv</a>(), <a href="qcolor.html#setHsvF">setHsvF</a>(), and <a href="qcolor.html#the-hsv-color-model">The HSV Color Model</a>.</p>
<!-- @@@setHsv -->
<!-- $$$setHsvF[overload1]$$$setHsvFqrealqrealqrealqreal -->
<h3 class="fn"><a name="setHsvF"></a><span class="type">void</span> QColor::<span class="name">setHsvF</span> ( <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>h</i>, <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>s</i>, <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>v</i>, <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>a</i> = 1.0 )</h3>
<p>Sets a HSV color value; <i>h</i> is the hue, <i>s</i> is the saturation, <i>v</i> is the value and <i>a</i> is the alpha component of the HSV color.</p>
<p>All the values must be in the range 0.0-1.0.</p>
<p><b>See also </b><a href="qcolor.html#getHsvF">getHsvF</a>(), <a href="qcolor.html#setHsv">setHsv</a>(), and <a href="qcolor.html#the-hsv-color-model">The HSV Color Model</a>.</p>
<!-- @@@setHsvF -->
<!-- $$$setNamedColor[overload1]$$$setNamedColorconstQString& -->
<h3 class="fn"><a name="setNamedColor"></a><span class="type">void</span> QColor::<span class="name">setNamedColor</span> ( const <span class="type"><a href="qstring.html">QString</a></span> & <i>name</i> )</h3>
<p>Sets the RGB value of this <a href="qcolor.html">QColor</a> to <i>name</i>, which may be in one of these formats:</p>
<ul>
<li>#RGB (each of R, G, and B is a single hex digit)</li>
<li>#RRGGBB</li>
<li>#RRRGGGBBB</li>
<li>#RRRRGGGGBBBB</li>
<li>A name from the list of colors defined in the list of <a href="http://www.w3.org/TR/SVG/types.html#ColorKeywords">SVG color keyword names</a> provided by the World Wide Web Consortium; for example, "steelblue" or "gainsboro". These color names work on all platforms. Note that these color names are <i>not</i> the same as defined by the <a href="qt.html#GlobalColor-enum">Qt::GlobalColor</a> enums, e.g. "green" and <a href="qt.html#GlobalColor-enum">Qt::green</a> does not refer to the same color.</li>
<li><tt>transparent</tt> - representing the absence of a color.</li>
<li><i>X11 only</i>: If <a href="qcolor.html#allowX11ColorNames">allowX11ColorNames</a>() returns true, any valid X11 color name. See the documentation for <tt>XParseColor()</tt> for information about valid X11 color names.</li>
</ul>
<p>The color is invalid if <i>name</i> cannot be parsed.</p>
<p><b>See also </b><a href="qcolor.html#QColor">QColor</a>(), <a href="qcolor.html#name">name</a>(), <a href="qcolor.html#isValid">isValid</a>(), and <a href="qcolor.html#allowX11ColorNames">allowX11ColorNames</a>().</p>
<!-- @@@setNamedColor -->
<!-- $$$setRed[overload1]$$$setRedint -->
<h3 class="fn"><a name="setRed"></a><span class="type">void</span> QColor::<span class="name">setRed</span> ( <span class="type">int</span> <i>red</i> )</h3>
<p>Sets the red color component of this color to <i>red</i>. Integer components are specified in the range 0-255.</p>
<p><b>See also </b><a href="qcolor.html#red">red</a>(), <a href="qcolor.html#redF">redF</a>(), and <a href="qcolor.html#setRgb">setRgb</a>().</p>
<!-- @@@setRed -->
<!-- $$$setRedF[overload1]$$$setRedFqreal -->
<h3 class="fn"><a name="setRedF"></a><span class="type">void</span> QColor::<span class="name">setRedF</span> ( <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>red</i> )</h3>
<p>Sets the red color component of this color to <i>red</i>. Float components are specified in the range 0.0-1.0.</p>
<p><b>See also </b><a href="qcolor.html#redF">redF</a>(), <a href="qcolor.html#red">red</a>(), and <a href="qcolor.html#setRgbF">setRgbF</a>().</p>
<!-- @@@setRedF -->
<!-- $$$setRgb[overload1]$$$setRgbintintintint -->
<h3 class="fn"><a name="setRgb"></a><span class="type">void</span> QColor::<span class="name">setRgb</span> ( <span class="type">int</span> <i>r</i>, <span class="type">int</span> <i>g</i>, <span class="type">int</span> <i>b</i>, <span class="type">int</span> <i>a</i> = 255 )</h3>
<p>Sets the RGB value to <i>r</i>, <i>g</i>, <i>b</i> and the alpha value to <i>a</i>.</p>
<p>All the values must be in the range 0-255.</p>
<p><b>See also </b><a href="qcolor.html#rgb">rgb</a>(), <a href="qcolor.html#getRgb">getRgb</a>(), and <a href="qcolor.html#setRgbF">setRgbF</a>().</p>
<!-- @@@setRgb -->
<!-- $$$setRgb$$$setRgbQRgb -->
<h3 class="fn"><a name="setRgb-2"></a><span class="type">void</span> QColor::<span class="name">setRgb</span> ( <span class="type"><a href="qcolor.html#QRgb-typedef">QRgb</a></span> <i>rgb</i> )</h3>
<p>This is an overloaded function.</p>
<p>Sets the RGB value to <i>rgb</i>. The alpha value is set to opaque.</p>
<!-- @@@setRgb -->
<!-- $$$setRgbF[overload1]$$$setRgbFqrealqrealqrealqreal -->
<h3 class="fn"><a name="setRgbF"></a><span class="type">void</span> QColor::<span class="name">setRgbF</span> ( <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>r</i>, <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>g</i>, <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>b</i>, <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>a</i> = 1.0 )</h3>
<p>Sets the color channels of this color to <i>r</i> (red), <i>g</i> (green), <i>b</i> (blue) and <i>a</i> (alpha, transparency).</p>
<p>All values must be in the range 0.0-1.0.</p>
<p><b>See also </b><a href="qcolor.html#rgb">rgb</a>(), <a href="qcolor.html#getRgbF">getRgbF</a>(), and <a href="qcolor.html#setRgb">setRgb</a>().</p>
<!-- @@@setRgbF -->
<!-- $$$setRgba[overload1]$$$setRgbaQRgb -->
<h3 class="fn"><a name="setRgba"></a><span class="type">void</span> QColor::<span class="name">setRgba</span> ( <span class="type"><a href="qcolor.html#QRgb-typedef">QRgb</a></span> <i>rgba</i> )</h3>
<p>Sets the RGB value to <i>rgba</i>, including its alpha.</p>
<p><b>See also </b><a href="qcolor.html#rgba">rgba</a>() and <a href="qcolor.html#rgb">rgb</a>().</p>
<!-- @@@setRgba -->
<!-- $$$spec[overload1]$$$spec -->
<h3 class="fn"><a name="spec"></a><span class="type"><a href="qcolor.html#Spec-enum">Spec</a></span> QColor::<span class="name">spec</span> () const</h3>
<p>Returns how the color was specified.</p>
<p><b>See also </b><a href="qcolor.html#Spec-enum">Spec</a> and <a href="qcolor.html#convertTo">convertTo</a>().</p>
<!-- @@@spec -->
<!-- $$$toCmyk[overload1]$$$toCmyk -->
<h3 class="fn"><a name="toCmyk"></a><span class="type">QColor</span> QColor::<span class="name">toCmyk</span> () const</h3>
<p>Creates and returns a CMYK <a href="qcolor.html">QColor</a> based on this color.</p>
<p><b>See also </b><a href="qcolor.html#fromCmyk">fromCmyk</a>(), <a href="qcolor.html#convertTo">convertTo</a>(), <a href="qcolor.html#isValid">isValid</a>(), and <a href="qcolor.html#the-cmyk-color-model">The CMYK Color Model</a>.</p>
<!-- @@@toCmyk -->
<!-- $$$toHsl[overload1]$$$toHsl -->
<h3 class="fn"><a name="toHsl"></a><span class="type">QColor</span> QColor::<span class="name">toHsl</span> () const</h3>
<p>Creates and returns an HSL <a href="qcolor.html">QColor</a> based on this color.</p>
<p><b>See also </b><a href="qcolor.html#fromHsl">fromHsl</a>(), <a href="qcolor.html#convertTo">convertTo</a>(), and <a href="qcolor.html#isValid">isValid</a>().</p>
<!-- @@@toHsl -->
<!-- $$$toHsv[overload1]$$$toHsv -->
<h3 class="fn"><a name="toHsv"></a><span class="type">QColor</span> QColor::<span class="name">toHsv</span> () const</h3>
<p>Creates and returns an HSV <a href="qcolor.html">QColor</a> based on this color.</p>
<p><b>See also </b><a href="qcolor.html#fromHsv">fromHsv</a>(), <a href="qcolor.html#convertTo">convertTo</a>(), <a href="qcolor.html#isValid">isValid</a>(), and <a href="qcolor.html#the-hsv-color-model">The HSV Color Model</a>.</p>
<!-- @@@toHsv -->
<!-- $$$toRgb[overload1]$$$toRgb -->
<h3 class="fn"><a name="toRgb"></a><span class="type">QColor</span> QColor::<span class="name">toRgb</span> () const</h3>
<p>Create and returns an RGB <a href="qcolor.html">QColor</a> based on this color.</p>
<p><b>See also </b><a href="qcolor.html#fromRgb">fromRgb</a>(), <a href="qcolor.html#convertTo">convertTo</a>(), and <a href="qcolor.html#isValid">isValid</a>().</p>
<!-- @@@toRgb -->
<!-- $$$value[overload1]$$$value -->
<h3 class="fn"><a name="value"></a><span class="type">int</span> QColor::<span class="name">value</span> () const</h3>
<p>Returns the value color component of this color.</p>
<p><b>See also </b><a href="qcolor.html#valueF">valueF</a>(), <a href="qcolor.html#getHsv">getHsv</a>(), and <a href="qcolor.html#the-hsv-color-model">The HSV Color Model</a>.</p>
<!-- @@@value -->
<!-- $$$valueF[overload1]$$$valueF -->
<h3 class="fn"><a name="valueF"></a><span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> QColor::<span class="name">valueF</span> () const</h3>
<p>Returns the value color component of this color.</p>
<p><b>See also </b><a href="qcolor.html#value">value</a>(), <a href="qcolor.html#getHsvF">getHsvF</a>(), and <a href="qcolor.html#the-hsv-color-model">The HSV Color Model</a>.</p>
<!-- @@@valueF -->
<!-- $$$yellow[overload1]$$$yellow -->
<h3 class="fn"><a name="yellow"></a><span class="type">int</span> QColor::<span class="name">yellow</span> () const</h3>
<p>Returns the yellow color component of this color.</p>
<p><b>See also </b><a href="qcolor.html#yellowF">yellowF</a>(), <a href="qcolor.html#getCmyk">getCmyk</a>(), and <a href="qcolor.html#the-cmyk-color-model">The CMYK Color Model</a>.</p>
<!-- @@@yellow -->
<!-- $$$yellowF[overload1]$$$yellowF -->
<h3 class="fn"><a name="yellowF"></a><span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> QColor::<span class="name">yellowF</span> () const</h3>
<p>Returns the yellow color component of this color.</p>
<p><b>See also </b><a href="qcolor.html#yellow">yellow</a>(), <a href="qcolor.html#getCmykF">getCmykF</a>(), and <a href="qcolor.html#the-cmyk-color-model">The CMYK Color Model</a>.</p>
<!-- @@@yellowF -->
<!-- $$$operator QVariant[overload1]$$$operator QVariant -->
<h3 class="fn"><a name="operator-QVariant"></a>QColor::<span class="name">operator QVariant</span> () const</h3>
<p>Returns the color as a <a href="qvariant.html">QVariant</a></p>
<!-- @@@operator QVariant -->
<!-- $$$operator!=[overload1]$$$operator!=constQColor& -->
<h3 class="fn"><a name="operator-not-eq"></a><span class="type">bool</span> QColor::<span class="name">operator!=</span> ( const <span class="type">QColor</span> & <i>color</i> ) const</h3>
<p>Returns true if this color has a different RGB and alpha values from <i>color</i>; otherwise returns false.</p>
<!-- @@@operator!= -->
<!-- $$$operator=[overload1]$$$operator=constQColor& -->
<h3 class="fn"><a name="operator-eq"></a><span class="type">QColor</span> & QColor::<span class="name">operator=</span> ( const <span class="type">QColor</span> & <i>color</i> )</h3>
<p>Assigns a copy of <i>color</i> to this color, and returns a reference to it.</p>
<!-- @@@operator= -->
<!-- $$$operator=$$$operator=Qt::GlobalColor -->
<h3 class="fn"><a name="operator-eq-2"></a><span class="type">QColor</span> & QColor::<span class="name">operator=</span> ( <span class="type"><a href="qt.html#GlobalColor-enum">Qt::GlobalColor</a></span> <i>color</i> )</h3>
<p>This is an overloaded function.</p>
<p>Assigns a copy of <i>color</i> and returns a reference to this color.</p>
<!-- @@@operator= -->
<!-- $$$operator==[overload1]$$$operator==constQColor& -->
<h3 class="fn"><a name="operator-eq-eq"></a><span class="type">bool</span> QColor::<span class="name">operator==</span> ( const <span class="type">QColor</span> & <i>color</i> ) const</h3>
<p>Returns true if this color has the same RGB and alpha values as <i>color</i>; otherwise returns false.</p>
<!-- @@@operator== -->
</div>
<div class="relnonmem">
<h2>Related Non-Members</h2>
<!-- $$$QRgb -->
<h3 class="fn"><a name="QRgb-typedef"></a>typedef <span class="name">QRgb</span></h3>
<p>An ARGB quadruplet on the format #AARRGGBB, equivalent to an unsigned int.</p>
<p>The type also holds a value for the alpha-channel. The default alpha channel is <tt>ff</tt>, i.e opaque. For more information, see the <a href="qcolor.html#alpha-blended-drawing">Alpha-Blended Drawing</a> section.</p>
<p><b>See also </b><a href="qcolor.html#rgb">QColor::rgb</a>() and <a href="qcolor.html#rgba">QColor::rgba</a>().</p>
<!-- @@@QRgb -->
<!-- $$$qAlpha[overload1]$$$qAlphaQRgb -->
<h3 class="fn"><a name="qAlpha"></a><span class="type">int</span> <span class="name">qAlpha</span> ( <span class="type"><a href="qcolor.html#QRgb-typedef">QRgb</a></span> <i>rgba</i> )</h3>
<p>Returns the alpha component of the ARGB quadruplet <i>rgba</i>.</p>
<p><b>See also </b><a href="qcolor.html#qRgb">qRgb</a>() and <a href="qcolor.html#alpha">QColor::alpha</a>().</p>
<!-- @@@qAlpha -->
<!-- $$$qBlue[overload1]$$$qBlueQRgb -->
<h3 class="fn"><a name="qBlue"></a><span class="type">int</span> <span class="name">qBlue</span> ( <span class="type"><a href="qcolor.html#QRgb-typedef">QRgb</a></span> <i>rgb</i> )</h3>
<p>Returns the blue component of the ARGB quadruplet <i>rgb</i>.</p>
<p><b>See also </b><a href="qcolor.html#qRgb">qRgb</a>() and <a href="qcolor.html#blue">QColor::blue</a>().</p>
<!-- @@@qBlue -->
<!-- $$$qGray[overload1]$$$qGrayintintint -->
<h3 class="fn"><a name="qGray"></a><span class="type">int</span> <span class="name">qGray</span> ( <span class="type">int</span> <i>r</i>, <span class="type">int</span> <i>g</i>, <span class="type">int</span> <i>b</i> )</h3>
<p>Returns a gray value (0 to 255) from the (<i>r</i>, <i>g</i>, <i>b</i>) triplet.</p>
<p>The gray value is calculated using the formula (<i>r</i> * 11 + <i>g</i> * 16 + <i>b</i> * 5)/32.</p>
<!-- @@@qGray -->
<!-- $$$qGray$$$qGrayQRgb -->
<h3 class="fn"><a name="qGray-2"></a><span class="type">int</span> <span class="name">qGray</span> ( <span class="type"><a href="qcolor.html#QRgb-typedef">QRgb</a></span> <i>rgb</i> )</h3>
<p>This is an overloaded function.</p>
<p>Returns a gray value (0 to 255) from the given ARGB quadruplet <i>rgb</i>.</p>
<p>The gray value is calculated using the formula (R * 11 + G * 16 + B * 5)/32; the alpha-channel is ignored.</p>
<!-- @@@qGray -->
<!-- $$$qGreen[overload1]$$$qGreenQRgb -->
<h3 class="fn"><a name="qGreen"></a><span class="type">int</span> <span class="name">qGreen</span> ( <span class="type"><a href="qcolor.html#QRgb-typedef">QRgb</a></span> <i>rgb</i> )</h3>
<p>Returns the green component of the ARGB quadruplet <i>rgb</i>.</p>
<p><b>See also </b><a href="qcolor.html#qRgb">qRgb</a>() and <a href="qcolor.html#green">QColor::green</a>().</p>
<!-- @@@qGreen -->
<!-- $$$qRed[overload1]$$$qRedQRgb -->
<h3 class="fn"><a name="qRed"></a><span class="type">int</span> <span class="name">qRed</span> ( <span class="type"><a href="qcolor.html#QRgb-typedef">QRgb</a></span> <i>rgb</i> )</h3>
<p>Returns the red component of the ARGB quadruplet <i>rgb</i>.</p>
<p><b>See also </b><a href="qcolor.html#qRgb">qRgb</a>() and <a href="qcolor.html#red">QColor::red</a>().</p>
<!-- @@@qRed -->
<!-- $$$qRgb[overload1]$$$qRgbintintint -->
<h3 class="fn"><a name="qRgb"></a><span class="type"><a href="qcolor.html#QRgb-typedef">QRgb</a></span> <span class="name">qRgb</span> ( <span class="type">int</span> <i>r</i>, <span class="type">int</span> <i>g</i>, <span class="type">int</span> <i>b</i> )</h3>
<p>Returns the ARGB quadruplet (255, <i>r</i>, <i>g</i>, <i>b</i>).</p>
<p><b>See also </b><a href="qcolor.html#qRgba">qRgba</a>(), <a href="qcolor.html#qRed">qRed</a>(), <a href="qcolor.html#qGreen">qGreen</a>(), and <a href="qcolor.html#qBlue">qBlue</a>().</p>
<!-- @@@qRgb -->
<!-- $$$qRgba[overload1]$$$qRgbaintintintint -->
<h3 class="fn"><a name="qRgba"></a><span class="type"><a href="qcolor.html#QRgb-typedef">QRgb</a></span> <span class="name">qRgba</span> ( <span class="type">int</span> <i>r</i>, <span class="type">int</span> <i>g</i>, <span class="type">int</span> <i>b</i>, <span class="type">int</span> <i>a</i> )</h3>
<p>Returns the ARGB quadruplet (<i>a</i>, <i>r</i>, <i>g</i>, <i>b</i>).</p>
<p><b>See also </b><a href="qcolor.html#qRgb">qRgb</a>(), <a href="qcolor.html#qRed">qRed</a>(), <a href="qcolor.html#qGreen">qGreen</a>(), and <a href="qcolor.html#qBlue">qBlue</a>().</p>
<!-- @@@qRgba -->
<!-- $$$operator<<$$$operator<<QDataStream&constQColor& -->
<h3 class="fn"><a name="operator-lt-lt-46"></a><span class="type"><a href="qdatastream.html">QDataStream</a></span> & <span class="name">operator<<</span> ( <span class="type"><a href="qdatastream.html">QDataStream</a></span> & <i>stream</i>, const <span class="type">QColor</span> & <i>color</i> )</h3>
<p>Writes the <i>color</i> to the <i>stream</i>.</p>
<p><b>See also </b><a href="datastreamformat.html">Serializing Qt Data Types</a>.</p>
<!-- @@@operator<< -->
<!-- $$$operator>>$$$operator>>QDataStream&QColor& -->
<h3 class="fn"><a name="operator-gt-gt-24"></a><span class="type"><a href="qdatastream.html">QDataStream</a></span> & <span class="name">operator>></span> ( <span class="type"><a href="qdatastream.html">QDataStream</a></span> & <i>stream</i>, <span class="type">QColor</span> & <i>color</i> )</h3>
<p>Reads the <i>color</i> from the <i>stream</i>.</p>
<p><b>See also </b><a href="datastreamformat.html">Serializing Qt Data Types</a>.</p>
<!-- @@@operator>> -->
</div>
<div class="ft">
<span></span>
</div>
</div>
<div class="footer">
<p>
<acronym title="Copyright">©</acronym> 2012 Nokia Corporation and/or its
subsidiaries. Documentation contributions included herein are the copyrights of
their respective owners.</p>
<br />
<p>
The documentation provided herein is licensed under the terms of the
<a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation
License version 1.3</a> as published by the Free Software Foundation.</p>
<p>
Documentation sources may be obtained from <a href="http://www.qt-project.org">
www.qt-project.org</a>.</p>
<br />
<p>
Nokia, Qt and their respective logos are trademarks of Nokia Corporation
in Finland and/or other countries worldwide. All other trademarks are property
of their respective owners. <a title="Privacy Policy"
href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p>
</div>
</body>
</html>
|