Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

206 lines
9.7 KiB

  1. // color.h: declaration of functions to deal with HTML color
  2. #ifndef __COLOR_H_
  3. #define COLOR_H_
  4. #define MAX_COLOR_STR 30
  5. #define NUM_HTML_COLORS 140
  6. #define NUM_SYS_COLORS 28
  7. #define MAX_BINARY_STR 40
  8. struct ColorPair_S {
  9. WCHAR *pwzColorName;
  10. COLORREF colorRef;
  11. };
  12. struct ColorPair2_S {
  13. WCHAR *pwzColorName;
  14. int colorIndex;
  15. };
  16. const ColorPair_S ColorNames[] =
  17. {
  18. { L"aliceblue", 0xfff8f0 },
  19. { L"antiquewhite", 0xd7ebfa },
  20. { L"aqua", 0xffff00 },
  21. { L"aquamarine", 0xd4ff7f },
  22. { L"azure", 0xfffff0 },
  23. { L"beige", 0xdcf5f5 },
  24. { L"bisque", 0xc4e4ff },
  25. { L"black", 0x000000 },
  26. { L"blanchedalmond", 0xcdebff },
  27. { L"blue", 0xff0000 },
  28. { L"blueviolet", 0xe22b8a },
  29. { L"brown", 0x2a2aa5 },
  30. { L"burlywood", 0x87b8de },
  31. { L"cadetblue", 0xa09e5f },
  32. { L"chartreuse", 0x00ff7f },
  33. { L"chocolate", 0x1e69d2 },
  34. { L"coral", 0x507fff },
  35. { L"cornflowerblue", 0xed9564 },
  36. { L"cornsilk", 0xdcf8ff },
  37. { L"crimson", 0x3c14dc },
  38. { L"cyan", 0xffff00 },
  39. { L"darkblue", 0x8b0000 },
  40. { L"darkcyan", 0x8b8b00 },
  41. { L"darkgoldenrod", 0x0b86b8 },
  42. { L"darkgray", 0xa9a9a9 },
  43. { L"darkgreen", 0x006400 },
  44. { L"darkkhaki", 0x6bb7bd },
  45. { L"darkmagenta", 0x8b008b },
  46. { L"darkolivegreen", 0x2f6b55 },
  47. { L"darkorange", 0x008cff },
  48. { L"darkorchid", 0xcc3299 },
  49. { L"darkred", 0x00008b },
  50. { L"darksalmon", 0x7a96e9 },
  51. { L"darkseagreen", 0x8fbc8f },
  52. { L"darkslateblue", 0x8b3d48 },
  53. { L"darkslategray", 0x4f4f2f },
  54. { L"darkturquoise", 0xd1ce00 },
  55. { L"darkviolet", 0xd30094 },
  56. { L"deeppink", 0x9314ff },
  57. { L"deepskyblue", 0xffbf00 },
  58. { L"dimgray", 0x696969 },
  59. { L"dodgerblue", 0xff901e },
  60. { L"firebrick", 0x2222b2 },
  61. { L"floralwhite", 0xf0faff },
  62. { L"forestgreen", 0x228b22 },
  63. { L"fuchsia", 0xff00ff },
  64. { L"gainsboro", 0xdcdcdc },
  65. { L"ghostwhite", 0xfff8f8 },
  66. { L"gold", 0x00d7ff },
  67. { L"goldenrod", 0x20a5da },
  68. { L"gray", 0x808080 },
  69. { L"green", 0x008000 },
  70. { L"greenyellow", 0x2fffad },
  71. { L"honeydew", 0xf0fff0 },
  72. { L"hotpink", 0xb469ff },
  73. { L"indianred", 0x5c5ccd },
  74. { L"indigo", 0x82004b },
  75. { L"ivory", 0xf0ffff },
  76. { L"khaki", 0x8ce6f0 },
  77. { L"lavender", 0xfae6e6 },
  78. { L"lavenderblush", 0xf5f0ff },
  79. { L"lawngreen", 0x00fc7c },
  80. { L"lemonchiffn", 0xcdfaff },
  81. { L"lightblue", 0xe6d8ad },
  82. { L"lightcoral", 0x8080f0 },
  83. { L"lightcyan", 0xffffe0 },
  84. { L"lightgoldenrodyellow", 0xd2fafa },
  85. { L"lightgreen", 0x90ee90 },
  86. { L"lightgrey", 0xd3d3d3 },
  87. { L"lightpink", 0xc1b6ff },
  88. { L"lightsalmon", 0x7aa0ff },
  89. { L"lightseagreen", 0xaab220 },
  90. { L"lightskyblue", 0xface87 },
  91. { L"lightslategray", 0x998877 },
  92. { L"lightsteelblue", 0xdec4b0 },
  93. { L"lightyellow", 0xe0ffff },
  94. { L"lime", 0x00ff00 },
  95. { L"limegreen", 0x32cd32 },
  96. { L"linen", 0xe6f0fa },
  97. { L"magenta", 0xff00ff },
  98. { L"maroon", 0x000080 },
  99. { L"mediumaquamarine", 0xaacd66 },
  100. { L"mediumblue", 0xcd0000 },
  101. { L"mediumorchid", 0xd355ba },
  102. { L"mediumpurple", 0xdb7093 },
  103. { L"mediumseagreen", 0x71b33c },
  104. { L"mediumslateblue", 0xee687b },
  105. { L"mediumspringgreen", 0x9afa00 },
  106. { L"mediumturquoise", 0xccd148 },
  107. { L"mediumvioletred", 0x8515c7 },
  108. { L"midnightblue", 0x701919 },
  109. { L"mintcream", 0xfafff5 },
  110. { L"mistyrose", 0xe1e4ff },
  111. { L"moccasin", 0xb5e4ff },
  112. { L"navajowhite", 0xaddeff },
  113. { L"navy", 0x800000 },
  114. { L"oldlace", 0xe6f5fd },
  115. { L"olive", 0x008080 },
  116. { L"olivedrab", 0x238e6b },
  117. { L"orange", 0x00a5ff },
  118. { L"orangered", 0x0045ff },
  119. { L"orchid", 0xd670da },
  120. { L"palegoldenrod", 0xaae8ee },
  121. { L"palegreen", 0x98fb98 },
  122. { L"paleturquoise", 0xeeeeaf },
  123. { L"palevioletred", 0x9370db },
  124. { L"papayawhip", 0xd5efff },
  125. { L"peachpuff", 0xb9daff },
  126. { L"peru", 0x3f85cd },
  127. { L"pink", 0xcbc0ff },
  128. { L"plum", 0xdda0dd },
  129. { L"powderblue", 0xe6e0b0 },
  130. { L"purple", 0x800080 },
  131. { L"red", 0x0000ff },
  132. { L"rosybrown", 0x8f8fbc },
  133. { L"royalblue", 0xe16941 },
  134. { L"saddlebrown", 0x13458b },
  135. { L"salmon", 0x7280fa },
  136. { L"sandybrown", 0x60a4f4 },
  137. { L"seagreen", 0x578b2e },
  138. { L"seashell", 0xeef5ff },
  139. { L"sienna", 0x2d52a0 },
  140. { L"silver", 0xc0c0c0 },
  141. { L"skyblue", 0xebce87 },
  142. { L"slateblue", 0xcd5a6a },
  143. { L"slategray", 0x908070 },
  144. { L"snow", 0xfafaff },
  145. { L"springgreen", 0x7fff00 },
  146. { L"steelblue", 0xb48246 },
  147. { L"tan", 0x8cb4d2 },
  148. { L"teal", 0x808000 },
  149. { L"thistle", 0xd8bfd8 },
  150. { L"tomato", 0x4763ff },
  151. { L"turquoise", 0xd0e040 },
  152. { L"violet", 0xee82ee },
  153. { L"wheat", 0xb3def5 },
  154. { L"white", 0xffffff },
  155. { L"whitesmoke", 0xf5f5f5 },
  156. { L"yellow", 0x00ffff },
  157. { L"yellowgreen", 0x32cd9a }
  158. };
  159. const ColorPair2_S SysColorNames[] =
  160. {
  161. { L"activeborder", COLOR_ACTIVEBORDER}, // Active window border.
  162. { L"activecaption", COLOR_ACTIVECAPTION}, // Active window caption.
  163. { L"appworkspace", COLOR_APPWORKSPACE}, // Background color of multiple document interface (MDI) applications.
  164. { L"background", COLOR_BACKGROUND}, // Desktop background.
  165. { L"buttonface", COLOR_BTNFACE}, // Face color for three-dimensional display elements.
  166. { L"buttonhighlight", COLOR_BTNHIGHLIGHT}, // Dark shadow for three-dimensional display elements.
  167. { L"buttonshadow", COLOR_BTNSHADOW}, // Shadow color for three-dimensional display elements (for edges facing away from the light source).
  168. { L"buttontext", COLOR_BTNTEXT}, // Text on push buttons.
  169. { L"captiontext", COLOR_CAPTIONTEXT}, // Text in caption, size box, and scroll bar arrow box.
  170. { L"graytext", COLOR_GRAYTEXT}, // Grayed (disabled) text. This color is set to 0 if the current display driver does not support a solid gray color.
  171. { L"highlight", COLOR_HIGHLIGHT}, // Item(s) selected in a control.
  172. { L"highlighttext", COLOR_HIGHLIGHTTEXT}, // Text of item(s) selected in a control.
  173. { L"inactiveborder", COLOR_INACTIVEBORDER}, // Inactive window border.
  174. { L"inactivecaption", COLOR_INACTIVECAPTION}, // Inactive window caption.
  175. { L"inactivecaptiontext", COLOR_INACTIVECAPTIONTEXT}, // Color of text in an inactive caption.
  176. { L"infobackground", COLOR_INFOBK}, // Background color for tooltip controls.
  177. { L"infotext", COLOR_INFOTEXT}, // Text color for tooltip controls.
  178. { L"menu", COLOR_MENU}, // Menu background.
  179. { L"menutext", COLOR_MENUTEXT}, // Text in menus.
  180. { L"scrollbar", COLOR_SCROLLBAR}, // Scroll bar gray area.
  181. { L"threeddarkshadow", COLOR_3DDKSHADOW }, // Dark shadow for three-dimensional display elements.
  182. { L"threedface", COLOR_3DFACE},
  183. { L"threedhighlight", COLOR_3DHIGHLIGHT}, // Highlight color for three-dimensional display elements (for edges facing the light source.)
  184. { L"threedlightshadow", COLOR_3DLIGHT}, // Light color for three-dimensional display elements (for edges facing the light source.)
  185. { L"threedshadow", COLOR_3DSHADOW}, // Dark shadow for three-dimensional display elements.
  186. { L"window", COLOR_WINDOW}, // Window background.
  187. { L"windowframe", COLOR_WINDOWFRAME}, // Window frame.
  188. { L"windowtext", COLOR_WINDOWTEXT} // Text in windows.
  189. };
  190. COLORREF ColorRefFromHTMLColorStrA(LPCSTR pszColor);
  191. COLORREF ColorRefFromHTMLColorStrW(LPCWSTR pwzColor);
  192. COLORREF HashStrToColorRefW(LPCWSTR pwzHashStr);
  193. COLORREF HashStrToColorRefA(LPCSTR pszHashStr);
  194. DWORD HexCharToDWORDW(WCHAR wcHexNum);
  195. #endif //__COLOR_H_