Embed:
(wiki syntax)
Show/hide line numbers
gdipluscolor.h
00001 /* 00002 * gdipluscolor.h 00003 * 00004 * GDI+ color 00005 * 00006 * This file is part of the w32api package. 00007 * 00008 * Contributors: 00009 * Created by Markus Koenig <markus@stber-koenig.de> 00010 * 00011 * THIS SOFTWARE IS NOT COPYRIGHTED 00012 * 00013 * This source code is offered for use in the public domain. You may 00014 * use, modify or distribute it freely. 00015 * 00016 * This code is distributed in the hope that it will be useful but 00017 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY 00018 * DISCLAIMED. This includes but is not limited to warranties of 00019 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00020 * 00021 */ 00022 00023 #ifndef __GDIPLUS_COLOR_H 00024 #define __GDIPLUS_COLOR_H 00025 #if __GNUC__ >=3 00026 #pragma GCC system_header 00027 #endif 00028 00029 typedef enum ColorChannelFlags { 00030 ColorChannelFlagsC = 0, 00031 ColorChannelFlagsM = 1, 00032 ColorChannelFlagsY = 2, 00033 ColorChannelFlagsK = 3, 00034 ColorChannelFlagsLast = 4 00035 } ColorChannelFlags; 00036 00037 typedef struct Color 00038 { 00039 #ifdef __cplusplus 00040 private: 00041 #endif 00042 ARGB Value; 00043 00044 #ifdef __cplusplus 00045 public: 00046 friend class Bitmap; 00047 friend class Graphics; 00048 friend class HatchBrush; 00049 friend class PathGradientBrush; 00050 friend class Pen; 00051 friend class SolidBrush; 00052 00053 static ARGB MakeARGB(BYTE a, BYTE r, BYTE g, BYTE b) 00054 { 00055 return (ARGB) ((((DWORD) a) << 24) | (((DWORD) r) << 16) 00056 | (((DWORD) g) << 8) | ((DWORD) b)); 00057 } 00058 00059 static const ARGB AlphaMask = 0xFF000000UL; 00060 00061 static const ARGB AliceBlue = 0xFFF0F8FFUL; 00062 static const ARGB AntiqueWhite = 0xFFFAEBD7UL; 00063 static const ARGB Aqua = 0xFF00FFFFUL; 00064 static const ARGB Aquamarine = 0xFF7FFFD4UL; 00065 static const ARGB Azure = 0xFFF0FFFFUL; 00066 static const ARGB Beige = 0xFFF5F5DCUL; 00067 static const ARGB Bisque = 0xFFFFE4C4UL; 00068 static const ARGB Black = 0xFF000000UL; 00069 static const ARGB BlanchedAlmond = 0xFFFFEBCDUL; 00070 static const ARGB Blue = 0xFF0000FFUL; 00071 static const ARGB BlueViolet = 0xFF8A2BE2UL; 00072 static const ARGB Brown = 0xFFA52A2AUL; 00073 static const ARGB BurlyWood = 0xFFDEB887UL; 00074 static const ARGB CadetBlue = 0xFF5F9EA0UL; 00075 static const ARGB Chartreuse = 0xFF7FFF00UL; 00076 static const ARGB Chocolate = 0xFFD2691EUL; 00077 static const ARGB Coral = 0xFFFF7F50UL; 00078 static const ARGB CornflowerBlue = 0xFF6495EDUL; 00079 static const ARGB Cornsilk = 0xFFFFF8DCUL; 00080 static const ARGB Crimson = 0xFFDC143CUL; 00081 static const ARGB Cyan = 0xFF00FFFFUL; 00082 static const ARGB DarkBlue = 0xFF00008BUL; 00083 static const ARGB DarkCyan = 0xFF008B8BUL; 00084 static const ARGB DarkGoldenrod = 0xFFB8860BUL; 00085 static const ARGB DarkGray = 0xFFA9A9A9UL; 00086 static const ARGB DarkGreen = 0xFF006400UL; 00087 static const ARGB DarkKhaki = 0xFFBDB76BUL; 00088 static const ARGB DarkMagenta = 0xFF8B008BUL; 00089 static const ARGB DarkOliveGreen = 0xFF556B2FUL; 00090 static const ARGB DarkOrange = 0xFFFF8C00UL; 00091 static const ARGB DarkOrchid = 0xFF9932CCUL; 00092 static const ARGB DarkRed = 0xFF8B0000UL; 00093 static const ARGB DarkSalmon = 0xFFE9967AUL; 00094 static const ARGB DarkSeaGreen = 0xFF8FBC8FUL; 00095 static const ARGB DarkSlateBlue = 0xFF483D8BUL; 00096 static const ARGB DarkSlateGray = 0xFF2F4F4FUL; 00097 static const ARGB DarkTurquoise = 0xFF00CED1UL; 00098 static const ARGB DarkViolet = 0xFF9400D3UL; 00099 static const ARGB DeepPink = 0xFFFF1493UL; 00100 static const ARGB DeepSkyBlue = 0xFF00BFFFUL; 00101 static const ARGB DimGray = 0xFF696969UL; 00102 static const ARGB DodgerBlue = 0xFF1E90FFUL; 00103 static const ARGB Firebrick = 0xFFB22222UL; 00104 static const ARGB FloralWhite = 0xFFFFFAF0UL; 00105 static const ARGB ForestGreen = 0xFF228B22UL; 00106 static const ARGB Fuchsia = 0xFFFF00FFUL; 00107 static const ARGB Gainsboro = 0xFFDCDCDCUL; 00108 static const ARGB GhostWhite = 0xFFF8F8FFUL; 00109 static const ARGB Gold = 0xFFFFD700UL; 00110 static const ARGB Goldenrod = 0xFFDAA520UL; 00111 static const ARGB Gray = 0xFF808080UL; 00112 static const ARGB Green = 0xFF008000UL; 00113 static const ARGB GreenYellow = 0xFFADFF2FUL; 00114 static const ARGB Honeydew = 0xFFF0FFF0UL; 00115 static const ARGB HotPink = 0xFFFF69B4UL; 00116 static const ARGB IndianRed = 0xFFCD5C5CUL; 00117 static const ARGB Indigo = 0xFF4B0082UL; 00118 static const ARGB Ivory = 0xFFFFFFF0UL; 00119 static const ARGB Khaki = 0xFFF0E68CUL; 00120 static const ARGB Lavender = 0xFFE6E6FAUL; 00121 static const ARGB LavenderBlush = 0xFFFFF0F5UL; 00122 static const ARGB LawnGreen = 0xFF7CFC00UL; 00123 static const ARGB LemonChiffon = 0xFFFFFACDUL; 00124 static const ARGB LightBlue = 0xFFADD8E6UL; 00125 static const ARGB LightCoral = 0xFFF08080UL; 00126 static const ARGB LightCyan = 0xFFE0FFFFUL; 00127 static const ARGB LightGoldenrodYellow = 0xFFFAFAD2UL; 00128 static const ARGB LightGray = 0xFFD3D3D3UL; 00129 static const ARGB LightGreen = 0xFF90EE90UL; 00130 static const ARGB LightPink = 0xFFFFB6C1UL; 00131 static const ARGB LightSalmon = 0xFFFFA07AUL; 00132 static const ARGB LightSeaGreen = 0xFF20B2AAUL; 00133 static const ARGB LightSkyBlue = 0xFF87CEFAUL; 00134 static const ARGB LightSlateGray = 0xFF778899UL; 00135 static const ARGB LightSteelBlue = 0xFFB0C4DEUL; 00136 static const ARGB LightYellow = 0xFFFFFFE0UL; 00137 static const ARGB Lime = 0xFF00FF00UL; 00138 static const ARGB LimeGreen = 0xFF32CD32UL; 00139 static const ARGB Linen = 0xFFFAF0E6UL; 00140 static const ARGB Magenta = 0xFFFF00FFUL; 00141 static const ARGB Maroon = 0xFF800000UL; 00142 static const ARGB MediumAquamarine = 0xFF66CDAAUL; 00143 static const ARGB MediumBlue = 0xFF0000CDUL; 00144 static const ARGB MediumOrchid = 0xFFBA55D3UL; 00145 static const ARGB MediumPurple = 0xFF9370DBUL; 00146 static const ARGB MediumSeaGreen = 0xFF3CB371UL; 00147 static const ARGB MediumSlateBlue = 0xFF7B68EEUL; 00148 static const ARGB MediumSpringGreen = 0xFF00FA9AUL; 00149 static const ARGB MediumTurquoise = 0xFF48D1CCUL; 00150 static const ARGB MediumVioletRed = 0xFFC71585UL; 00151 static const ARGB MidnightBlue = 0xFF191970UL; 00152 static const ARGB MintCream = 0xFFF5FFFAUL; 00153 static const ARGB MistyRose = 0xFFFFE4E1UL; 00154 static const ARGB Moccasin = 0xFFFFE4B5UL; 00155 static const ARGB NavajoWhite = 0xFFFFDEADUL; 00156 static const ARGB Navy = 0xFF000080UL; 00157 static const ARGB OldLace = 0xFFFDF5E6UL; 00158 static const ARGB Olive = 0xFF808000UL; 00159 static const ARGB OliveDrab = 0xFF6B8E23UL; 00160 static const ARGB Orange = 0xFFFFA500UL; 00161 static const ARGB OrangeRed = 0xFFFF4500UL; 00162 static const ARGB Orchid = 0xFFDA70D6UL; 00163 static const ARGB PaleGoldenrod = 0xFFEEE8AAUL; 00164 static const ARGB PaleGreen = 0xFF98FB98UL; 00165 static const ARGB PaleTurquoise = 0xFFAFEEEEUL; 00166 static const ARGB PaleVioletRed = 0xFFDB7093UL; 00167 static const ARGB PapayaWhip = 0xFFFFEFD5UL; 00168 static const ARGB PeachPuff = 0xFFFFDAB9UL; 00169 static const ARGB Peru = 0xFFCD853FUL; 00170 static const ARGB Pink = 0xFFFFC0CBUL; 00171 static const ARGB Plum = 0xFFDDA0DDUL; 00172 static const ARGB PowderBlue = 0xFFB0E0E6UL; 00173 static const ARGB Purple = 0xFF800080UL; 00174 static const ARGB Red = 0xFFFF0000UL; 00175 static const ARGB RosyBrown = 0xFFBC8F8FUL; 00176 static const ARGB RoyalBlue = 0xFF4169E1UL; 00177 static const ARGB SaddleBrown = 0xFF8B4513UL; 00178 static const ARGB Salmon = 0xFFFA8072UL; 00179 static const ARGB SandyBrown = 0xFFF4A460UL; 00180 static const ARGB SeaGreen = 0xFF2E8B57UL; 00181 static const ARGB SeaShell = 0xFFFFF5EEUL; 00182 static const ARGB Sienna = 0xFFA0522DUL; 00183 static const ARGB Silver = 0xFFC0C0C0UL; 00184 static const ARGB SkyBlue = 0xFF87CEEBUL; 00185 static const ARGB SlateBlue = 0xFF6A5ACDUL; 00186 static const ARGB SlateGray = 0xFF708090UL; 00187 static const ARGB Snow = 0xFFFFFAFAUL; 00188 static const ARGB SpringGreen = 0xFF00FF7FUL; 00189 static const ARGB SteelBlue = 0xFF4682B4UL; 00190 static const ARGB Tan = 0xFFD2B48CUL; 00191 static const ARGB Teal = 0xFF008080UL; 00192 static const ARGB Thistle = 0xFFD8BFD8UL; 00193 static const ARGB Tomato = 0xFFFF6347UL; 00194 static const ARGB Transparent = 0x00FFFFFFUL; 00195 static const ARGB Turquoise = 0xFF40E0D0UL; 00196 static const ARGB Violet = 0xFFEE82EEUL; 00197 static const ARGB Wheat = 0xFFF5DEB3UL; 00198 static const ARGB White = 0xFFFFFFFFUL; 00199 static const ARGB WhiteSmoke = 0xFFF5F5F5UL; 00200 static const ARGB Yellow = 0xFFFFFF00UL; 00201 static const ARGB YellowGreen = 0xFF9ACD32UL; 00202 00203 Color(): Value(0xFF000000) {} 00204 Color(ARGB argb): Value(argb) {} 00205 Color(BYTE r, BYTE g, BYTE b): Value(MakeARGB(0xFF, r, g, b)) {} 00206 Color(BYTE a, BYTE r, BYTE g, BYTE b): Value(MakeARGB(a, r, g, b)) {} 00207 00208 BYTE GetA() const 00209 { 00210 return (BYTE) (Value >> 24); 00211 } 00212 BYTE GetAlpha() const 00213 { 00214 return (BYTE) (Value >> 24); 00215 } 00216 BYTE GetB() const 00217 { 00218 return (BYTE) Value; 00219 } 00220 BYTE GetBlue() const 00221 { 00222 return (BYTE) Value; 00223 } 00224 BYTE GetG() const 00225 { 00226 return (BYTE) (Value >> 8); 00227 } 00228 BYTE GetGreen() const 00229 { 00230 return (BYTE) (Value >> 8); 00231 } 00232 BYTE GetR() const 00233 { 00234 return (BYTE) (Value >> 16); 00235 } 00236 BYTE GetRed() const 00237 { 00238 return (BYTE) (Value >> 16); 00239 } 00240 ARGB GetValue() const 00241 { 00242 return Value; 00243 } 00244 VOID SetFromCOLORREF(COLORREF rgb) 00245 { 00246 BYTE r = (BYTE) rgb; 00247 BYTE g = (BYTE) (rgb >> 8); 00248 BYTE b = (BYTE) (rgb >> 16); 00249 Value = MakeARGB(0xFF, r, g, b); 00250 } 00251 VOID SetValue(ARGB argb) 00252 { 00253 Value = argb; 00254 } 00255 COLORREF ToCOLORREF() const 00256 { 00257 return RGB(GetRed(), GetGreen(), GetBlue()); 00258 } 00259 #endif /* __cplusplus */ 00260 } Color; 00261 00262 #endif /* __GDIPLUS_COLOR_H */
Generated on Tue Jul 12 2022 19:59:54 by
1.7.2