1#ifndef PHWIDGETS_COLOR_H
2#define PHWIDGETS_COLOR_H
33 Aqua =
static_cast<unsigned>(0xFF00FFFF),
35 Azure =
static_cast<unsigned>(0xFFF0FFFF),
36 Beige =
static_cast<unsigned>(0xFFF5F5DC),
37 Bisque =
static_cast<unsigned>(0xFFFFE4C4),
38 Black =
static_cast<unsigned>(0xFF000000),
40 Blue =
static_cast<unsigned>(0xFF0000FF),
42 Brown =
static_cast<unsigned>(0xFFA52A2A),
47 Coral =
static_cast<unsigned>(0xFFFF7F50),
50 Crimson =
static_cast<unsigned>(0xFFDC143C),
51 Cyan =
static_cast<unsigned>(0xFF00FFFF),
62 DarkRed =
static_cast<unsigned>(0xFF8B0000),
71 DimGray =
static_cast<unsigned>(0xFF696969),
76 Fuchsia =
static_cast<unsigned>(0xFFFF00FF),
79 Gold =
static_cast<unsigned>(0xFFFFD700),
81 Gray =
static_cast<unsigned>(0xFF808080),
82 Green =
static_cast<unsigned>(0xFF008000),
85 HotPink =
static_cast<unsigned>(0xFFFF69B4),
87 Indigo =
static_cast<unsigned>(0xFF4B0082),
88 Ivory =
static_cast<unsigned>(0xFFFFFFF0),
89 Khaki =
static_cast<unsigned>(0xFFF0E68C),
107 Lime =
static_cast<unsigned>(0xFF00FF00),
109 Linen =
static_cast<unsigned>(0xFFFAF0E6),
111 Maroon =
static_cast<unsigned>(0xFF800000),
126 Navy =
static_cast<unsigned>(0xFF000080),
128 Olive =
static_cast<unsigned>(0xFF808000),
130 Orange =
static_cast<unsigned>(0xFFFFA500),
132 Orchid =
static_cast<unsigned>(0xFFDA70D6),
139 Peru =
static_cast<unsigned>(0xFFCD853F),
140 Pink =
static_cast<unsigned>(0xFFFFC0CB),
141 Plum =
static_cast<unsigned>(0xFFDDA0DD),
143 Purple =
static_cast<unsigned>(0xFF800080),
144 Red =
static_cast<unsigned>(0xFFFF0000),
148 Salmon =
static_cast<unsigned>(0xFFFA8072),
152 Sienna =
static_cast<unsigned>(0xFFA0522D),
153 Silver =
static_cast<unsigned>(0xFFC0C0C0),
157 Snow =
static_cast<unsigned>(0xFFFFFAFA),
160 Tan =
static_cast<unsigned>(0xFFD2B48C),
161 Teal =
static_cast<unsigned>(0xFF008080),
163 Tomato =
static_cast<unsigned>(0xFFFF6347),
166 Violet =
static_cast<unsigned>(0xFFEE82EE),
167 Wheat =
static_cast<unsigned>(0xFFF5DEB3),
168 White =
static_cast<unsigned>(0xFFFFFFFF),
170 Yellow =
static_cast<unsigned>(0xFFFFFF00),
348 static Color FromARGB(
unsigned char alpha,
unsigned char red,
unsigned char green,
unsigned char blue);
361 static Color FromARGB(
unsigned char red,
unsigned char green,
unsigned char blue);
407 static Color FromCMY(
unsigned char cyan,
unsigned char magenta,
unsigned char yellow);
421 static Color FromHSV(
unsigned short hue,
unsigned char saturation,
unsigned char value);
440 const PgColorModel_t * cm = PgGetColorModel();
446 if(!(cm && cm->id != Pg_CM_RGB->id))
458 return (pg_color == ph_color);
462 bool operator==(
const PgColor_t &pg_color,
const Color &ph_color)
464 return (pg_color ==
static_cast<PgColor_t>(ph_color));
468 bool operator==(
const Color &ph_color,
const PgColor_t &pg_color)
470 return (pg_color == ph_color);
477 return (pg_color == ph_ecolor);
484 return (pg_color == ph_ecolor);
491 return !(pg_color == ph_color);
497 return !(ph_color == pg_color);
501 bool operator!=(
const PgColor_t &pg_color,
const Color &ph_color)
503 return !(pg_color == ph_color);
507 bool operator!=(
const Color &ph_color,
const PgColor_t &pg_color)
509 return !(pg_color == ph_color);
515 return !(ph_color == ph_ecolor);
521 return !(ph_color == ph_ecolor);
528 if (pg_color == ph_color)
530 return pg_color < static_cast<PgColor_t>(ph_color);
536 if (pg_color == ph_color)
538 return static_cast<PgColor_t>(ph_color) < pg_color;
542 bool operator<(
const PgColor_t &pg_color,
const Color &ph_color)
544 if (pg_color == ph_color)
546 return pg_color < static_cast<PgColor_t>(ph_color);
550 bool operator<(
const Color &ph_color,
const PgColor_t &pg_color)
552 if (pg_color == ph_color)
554 return static_cast<PgColor_t>(ph_color) < pg_color;
560 if (ph_color == ph_ecolor)
562 return static_cast<PgColor_t>(ph_color) < ph_ecolor;
568 if (ph_color == ph_ecolor)
570 return ph_ecolor < static_cast<PgColor_t>(ph_color);
577 if (pg_color == ph_color)
579 return pg_color < static_cast<PgColor_t>(ph_color);
585 if (pg_color == ph_color)
587 return static_cast<PgColor_t>(ph_color) < pg_color;
591 bool operator<=(
const PgColor_t &pg_color,
const Color &ph_color)
593 if (pg_color == ph_color)
595 return pg_color < static_cast<PgColor_t>(ph_color);
599 bool operator<=(
const Color &ph_color,
const PgColor_t &pg_color)
601 if (pg_color == ph_color)
603 return static_cast<PgColor_t>(ph_color) < pg_color;
609 if (ph_color == ph_ecolor)
611 return static_cast<PgColor_t>(ph_color) < ph_ecolor;
617 if (ph_color == ph_ecolor)
619 return ph_ecolor < static_cast<PgColor_t>(ph_color);
626 if (pg_color == ph_color)
628 return pg_color >
static_cast<PgColor_t>(ph_color);
634 if (pg_color == ph_color)
636 return static_cast<PgColor_t>(ph_color) > pg_color;
640 bool operator>(
const PgColor_t &pg_color,
const Color &ph_color)
642 if (pg_color == ph_color)
644 return pg_color >
static_cast<PgColor_t>(ph_color);
648 bool operator>(
const Color &ph_color,
const PgColor_t &pg_color)
650 if (pg_color == ph_color)
652 return static_cast<PgColor_t>(ph_color) > pg_color;
658 if (ph_color == ph_ecolor)
660 return static_cast<PgColor_t>(ph_color) > ph_ecolor;
666 if (ph_color == ph_ecolor)
668 return ph_ecolor >
static_cast<PgColor_t>(ph_color);
675 if (pg_color == ph_color)
677 return pg_color >
static_cast<PgColor_t>(ph_color);
683 if (pg_color == ph_color)
685 return static_cast<PgColor_t>(ph_color) > pg_color;
689 bool operator>=(
const PgColor_t &pg_color,
const Color &ph_color)
691 if (pg_color == ph_color)
693 return pg_color >
static_cast<PgColor_t>(ph_color);
697 bool operator>=(
const Color &ph_color,
const PgColor_t &pg_color)
699 if (pg_color == ph_color)
701 return static_cast<PgColor_t>(ph_color) > pg_color;
707 if (ph_color == ph_ecolor)
709 return static_cast<PgColor_t>(ph_color) > ph_ecolor;
715 if (ph_color == ph_ecolor)
717 return ph_ecolor >
static_cast<PgColor_t>(ph_color);