using System; namespace SAMP.API { public struct Color { #region Struct Variables private uint _color; #endregion #region Constructors /// /// Creates a SAMP.API.Color structure from a 32-bit ARGB value. /// /// A value specifying the 32-bit ARGB value. internal Color(uint argb) { // Store this._color = argb; } #endregion #region Static Methods /// /// Creates a SAMP.API.Color structure from a 32-bit ARGB value. /// /// A value specifying the 32-bit ARGB value. /// The SAMP.API.Color structure that this method creates. public static Color FromArgb(uint argb) { // Return the created colour return new Color(argb); } /// /// Creates a System.Drawing.Color structure from the specified 8-bit color values /// (red, green, and blue). The alpha value is implicitly 255 (fully opaque). /// Although this method allows a 32-bit value to be passed for each color component, /// the value of each component is limited to 8 bits. /// /// A value specifying the 32-bit ARGB value. /// The SAMP.API.Color structure that this method creates. public static Color FromArgb(int red, int green, int blue) { return FromArgb(255, red, green, blue); } /// /// Creates a SAMP.API.Color structure from the specified 8-bit color values /// (red, green, and blue). The alpha value is implicitly 255 (fully opaque). /// Although this method allows a 32-bit value to be passed for each color component, /// the value of each component is limited to 8 bits. /// /// The alpha component. Valid values are 0 through 255. /// The red component. Valid values are 0 through 255. /// The green component. Valid values are 0 through 255. /// The blue component. Valid values are 0 through 255. /// The SAMP.API.Color structure that this method creates. public static Color FromArgb(int alpha, int red, int green, int blue) { // Convert the passed parameters to a HTML colour string html = ArgbToHex(red, green, blue, alpha); // Convert the HTML colour to ARGB decimal notation uint argb = Convert.ToUInt32(html, 16); // Return the created colour return new Color(argb); } /// /// Creates a SAMP.API.Color structure from the specified Html color value (hexadecimal notation). /// /// A value specifying the Html color notation. /// The SAMP.API.Color structure that this method creates. public static Color FromHtml(string htmlColor) { // Truncate the HTML colour prefix ("0x" or "#") if necessary if(htmlColor.StartsWith("0x")) htmlColor = htmlColor.Substring(2); else if(htmlColor.StartsWith("#")) htmlColor = htmlColor.Substring(1); // Determine if the HTML has the correct length if(htmlColor.Length.Equals(6)) // Append an alpha value htmlColor = string.Format("{0}FF", htmlColor.ToUpper()); else if(htmlColor.Length.Equals(3)) { // Elongate shorthand HTML string r = htmlColor.Substring(0, 1), g = htmlColor.Substring(1, 1), b = htmlColor.Substring(2, 1); htmlColor = string.Format("{0}{0}{1}{1}{2}{2}FF", r, g, b); } // Convert the HTML colour to an ARGB decimal notation uint argb = Convert.ToUInt32(htmlColor, 16); // Return the created colour return new Color(argb); } #endregion #region Internal Methods internal static string ArgbToHex(int r, int g, int b) { return ArgbToHex(r, g, b, 255); } internal static string ArgbToHex(int r, int g, int b, int a) { string hr = r.ToString("X"), hg = g.ToString("X"), hb = b.ToString("X"), ha = a.ToString("X"); if(hr.Length < 2) hr = string.Format("0{0}", hr); if(hg.Length < 2) hg = string.Format("0{0}", hg); if(hb.Length < 2) hb = string.Format("0{0}", hb); if(ha.Length < 2) ha = string.Format("0{0}", ha); return string.Format("{0}{1}{2}{3}", hr, hg, hb, ha); } #endregion #region Public Methods /// /// Translates the specified SAMP.API.Color instance to an HTML string color representation. /// /// Whether or not to include the alpha channel. /// The string that represents the HTML color. public string ToHtml(bool alpha) { // Convert the Argb to a hexadecimal value string html = _color.ToString("X"); // Truncate to 6 characters if we want to omit the alpha channel if(!alpha) html = html.Substring(0, 6); // Return the HTML color representatio. return html; } /// /// Gets the 32-bit ARGB value of this SAMP.API.Color instance. /// /// The 32-bit ARGB value of this SAMP.API.Color. public uint ToArgb() { // Return the Argb value return _color; } #endregion #region Accessors & Mutators /// /// Gets the Red value of this Color. /// public byte R { get { string hex = _color.ToString("X"); string val = hex.Substring(0, 2); return Convert.ToByte(val, 16); } } /// /// Gets the Green value of this Color. /// public byte G { get { string hex = _color.ToString("X"); string val = hex.Substring(2, 2); return Convert.ToByte(val, 16); } } /// /// Gets the Blue value of this Color. /// public byte B { get { string hex = _color.ToString("X"); string val = hex.Substring(4, 2); return Convert.ToByte(val, 16); } } /// /// Gets the Alpha value of this Color. /// public byte A { get { string hex = _color.ToString("X"); string val = hex.Substring(6, 2); return Convert.ToByte(val, 16); } } #endregion #region Defined Colour Values /// /// Gets a system-defined color that has an ARGB value of #FFF0F8FF. /// public static Color AliceBlue { get { return FromHtml("F0F8FF"); } } /// /// Gets a system-defined color that has an ARGB value of #FFFAEBD7. /// public static Color AntiqueWhite { get { return FromHtml("FAEBD7"); } } /// /// Gets a system-defined color that has an ARGB value of #FF00FFFF. /// public static Color Aqua { get { return FromHtml("00FFFF"); } } /// /// Gets a system-defined color that has an ARGB value of #FF7FFFD4. /// public static Color Aquamarine { get { return FromHtml("7FFFD4"); } } /// /// Gets a system-defined color that has an ARGB value of #FFF0FFFF. /// public static Color Azure { get { return FromHtml("F0FFFF"); } } /// /// Gets a system-defined color that has an ARGB value of #FFF5F5DC. /// public static Color Beige { get { return FromHtml("F5F5DC"); } } /// /// Gets a system-defined color that has an ARGB value of #FFFFE4C4. /// public static Color Bisque { get { return FromHtml("FFE4C4"); } } /// /// Gets a system-defined color that has an ARGB value of #FF000000. /// public static Color Black { get { return FromHtml("000000"); } } /// /// Gets a system-defined color that has an ARGB value of #FFFFEBCD. /// public static Color BlanchedAlmond { get { return FromHtml("FFEBCD"); } } /// /// Gets a system-defined color that has an ARGB value of #FF0000FF. /// public static Color Blue { get { return FromHtml("0000FF"); } } /// /// Gets a system-defined color that has an ARGB value of #FF8A2BE2. /// public static Color BlueViolet { get { return FromHtml("8A2BE2"); } } /// /// Gets a system-defined color that has an ARGB value of #FFA52A2A. /// public static Color Brown { get { return FromHtml("A52A2A"); } } /// /// Gets a system-defined color that has an ARGB value of #FFDEB887. /// public static Color BurlyWood { get { return FromHtml("DEB887"); } } /// /// Gets a system-defined color that has an ARGB value of #FF5F9EA0. /// public static Color CadetBlue { get { return FromHtml("5F9EA0"); } } /// /// Gets a system-defined color that has an ARGB value of #FF7FFF00. /// public static Color Chartreuse { get { return FromHtml("7FFF00"); } } /// /// Gets a system-defined color that has an ARGB value of #FFD2691E. /// public static Color Chocolate { get { return FromHtml("D2691E"); } } /// /// Gets a system-defined color that has an ARGB value of #FFFF7F50. /// public static Color Coral { get { return FromHtml("FF7F50"); } } /// /// Gets a system-defined color that has an ARGB value of #FF6495ED. /// public static Color CornflowerBlue { get { return FromHtml("6495ED"); } } /// /// Gets a system-defined color that has an ARGB value of #FFFFF8DC. /// public static Color Cornsilk { get { return FromHtml("FFF8DC"); } } /// /// Gets a system-defined color that has an ARGB value of #FFDC143C. /// public static Color Crimson { get { return FromHtml("DC143C"); } } /// /// Gets a system-defined color that has an ARGB value of #FF00FFFF. /// public static Color Cyan { get { return FromHtml("00FFFF"); } } /// /// Gets a system-defined color that has an ARGB value of #FF00008B. /// public static Color DarkBlue { get { return FromHtml("00008B"); } } /// /// Gets a system-defined color that has an ARGB value of #FF008B8B. /// public static Color DarkCyan { get { return FromHtml("008B8B"); } } /// /// Gets a system-defined color that has an ARGB value of #FFB8860B. /// public static Color DarkGoldenrod { get { return FromHtml("B8860B"); } } /// /// Gets a system-defined color that has an ARGB value of #FFA9A9A9. /// public static Color DarkGray { get { return FromHtml("A9A9A9"); } } /// /// Gets a system-defined color that has an ARGB value of #FF006400. /// public static Color DarkGreen { get { return FromHtml("006400"); } } /// /// Gets a system-defined color that has an ARGB value of #FFBDB76B. /// public static Color DarkKhaki { get { return FromHtml("BDB76B"); } } /// /// Gets a system-defined color that has an ARGB value of #FF8B008B. /// public static Color DarkMagenta { get { return FromHtml("8B008B"); } } /// /// Gets a system-defined color that has an ARGB value of #FF556B2F. /// public static Color DarkOliveGreen { get { return FromHtml("556B2F"); } } /// /// Gets a system-defined color that has an ARGB value of #FFFF8C00. /// public static Color DarkOrange { get { return FromHtml("FF8C00"); } } /// /// Gets a system-defined color that has an ARGB value of #FF9932CC. /// public static Color DarkOrchid { get { return FromHtml("9932CC"); } } /// /// Gets a system-defined color that has an ARGB value of #FF8B0000. /// public static Color DarkRed { get { return FromHtml("8B0000"); } } /// /// Gets a system-defined color that has an ARGB value of #FFE9967A. /// public static Color DarkSalmon { get { return FromHtml("E9967A"); } } /// /// Gets a system-defined color that has an ARGB value of #FF8FBC8F. /// public static Color DarkSeaGreen { get { return FromHtml("8FBC8F"); } } /// /// Gets a system-defined color that has an ARGB value of #FF483D8B. /// public static Color DarkSlateBlue { get { return FromHtml("483D8B"); } } /// /// Gets a system-defined color that has an ARGB value of #FF2F4F4F. /// public static Color DarkSlateGray { get { return FromHtml("2F4F4F"); } } /// /// Gets a system-defined color that has an ARGB value of #FF00CED1. /// public static Color DarkTurquoise { get { return FromHtml("00CED1"); } } /// /// Gets a system-defined color that has an ARGB value of #FF9400D3. /// public static Color DarkViolet { get { return FromHtml("9400D3"); } } /// /// Gets a system-defined color that has an ARGB value of #FFFF1493. /// public static Color DeepPink { get { return FromHtml("FF1493"); } } /// /// Gets a system-defined color that has an ARGB value of #FF00BFFF. /// public static Color DeepSkyBlue { get { return FromHtml("00BFFF"); } } /// /// Gets a system-defined color that has an ARGB value of #FF696969. /// public static Color DimGray { get { return FromHtml("696969"); } } /// /// Gets a system-defined color that has an ARGB value of #FF1E90FF. /// public static Color DodgerBlue { get { return FromHtml("1E90FF"); } } /// /// Gets a system-defined color that has an ARGB value of #FFB22222. /// public static Color Firebrick { get { return FromHtml("B22222"); } } /// /// Gets a system-defined color that has an ARGB value of #FFFFFAF0. /// public static Color FloralWhite { get { return FromHtml("FFFAF0"); } } /// /// Gets a system-defined color that has an ARGB value of #FF228B22. /// public static Color ForestGreen { get { return FromHtml("228B22"); } } /// /// Gets a system-defined color that has an ARGB value of #FFFF00FF. /// public static Color Fuchsia { get { return FromHtml("FF00FF"); } } /// /// Gets a system-defined color that has an ARGB value of #FFDCDCDC. /// public static Color Gainsboro { get { return FromHtml("DCDCDC"); } } /// /// Gets a system-defined color that has an ARGB value of #FFF8F8FF. /// public static Color GhostWhite { get { return FromHtml("F8F8FF"); } } /// /// Gets a system-defined color that has an ARGB value of #FFFFD700. /// public static Color Gold { get { return FromHtml("FFD700"); } } /// /// Gets a system-defined color that has an ARGB value of #FFDAA520. /// public static Color Goldenrod { get { return FromHtml("DAA520"); } } /// /// Gets a system-defined color that has an ARGB value of #FF808080. /// public static Color Gray { get { return FromHtml("808080"); } } /// /// Gets a system-defined color that has an ARGB value of #FF008000. /// public static Color Green { get { return FromHtml("008000"); } } /// /// Gets a system-defined color that has an ARGB value of #FFADFF2F. /// public static Color GreenYellow { get { return FromHtml("ADFF2F"); } } /// /// Gets a system-defined color that has an ARGB value of #FFF0FFF0. /// public static Color Honeydew { get { return FromHtml("F0FFF0"); } } /// /// Gets a system-defined color that has an ARGB value of #FFFF69B4. /// public static Color HotPink { get { return FromHtml("FF69B4"); } } /// /// Gets a system-defined color that has an ARGB value of #FFCD5C5C. /// public static Color IndianRed { get { return FromHtml("CD5C5C"); } } /// /// Gets a system-defined color that has an ARGB value of #FF4B0082. /// public static Color Indigo { get { return FromHtml("4B0082"); } } /// /// Gets a system-defined color that has an ARGB value of #FFFFFFF0. /// public static Color Ivory { get { return FromHtml("FFFFF0"); } } /// /// Gets a system-defined color that has an ARGB value of #FFF0E68C. /// public static Color Khaki { get { return FromHtml("F0E68C"); } } /// /// Gets a system-defined color that has an ARGB value of #FFE6E6FA. /// public static Color Lavender { get { return FromHtml("E6E6FA"); } } /// /// Gets a system-defined color that has an ARGB value of #FFFFF0F5. /// public static Color LavenderBlush { get { return FromHtml("FFF0F5"); } } /// /// Gets a system-defined color that has an ARGB value of #FF7CFC00. /// public static Color LawnGreen { get { return FromHtml("7CFC00"); } } /// /// Gets a system-defined color that has an ARGB value of #FFFFFACD. /// public static Color LemonChiffon { get { return FromHtml("FFFACD"); } } /// /// Gets a system-defined color that has an ARGB value of #FFADD8E6. /// public static Color LightBlue { get { return FromHtml("ADD8E6"); } } /// /// Gets a system-defined color that has an ARGB value of #FFF08080. /// public static Color LightCoral { get { return FromHtml("F08080"); } } /// /// Gets a system-defined color that has an ARGB value of #FFE0FFFF. /// public static Color LightCyan { get { return FromHtml("E0FFFF"); } } /// /// Gets a system-defined color that has an ARGB value of #FFFAFAD2. /// public static Color LightGoldenrodYellow { get { return FromHtml("FAFAD2"); } } /// /// Gets a system-defined color that has an ARGB value of #FFD3D3D3. /// public static Color LightGray { get { return FromHtml("D3D3D3"); } } /// /// Gets a system-defined color that has an ARGB value of #FF90EE90. /// public static Color LightGreen { get { return FromHtml("90EE90"); } } /// /// Gets a system-defined color that has an ARGB value of #FFFFB6C1. /// public static Color LightPink { get { return FromHtml("FFB6C1"); } } /// /// Gets a system-defined color that has an ARGB value of #FFFFA07A. /// public static Color LightSalmon { get { return FromHtml("FFA07A"); } } /// /// Gets a system-defined color that has an ARGB value of #FF20B2AA. /// public static Color LightSeaGreen { get { return FromHtml("20B2AA"); } } /// /// Gets a system-defined color that has an ARGB value of #FF87CEFA. /// public static Color LightSkyBlue { get { return FromHtml("87CEFA"); } } /// /// Gets a system-defined color that has an ARGB value of #FF778899. /// public static Color LightSlateGray { get { return FromHtml("778899"); } } /// /// Gets a system-defined color that has an ARGB value of #FFB0C4DE. /// public static Color LightSteelBlue { get { return FromHtml("B0C4DE"); } } /// /// Gets a system-defined color that has an ARGB value of #FFFFFFE0. /// public static Color LightYellow { get { return FromHtml("FFFFE0"); } } /// /// Gets a system-defined color that has an ARGB value of #FF00FF00. /// public static Color Lime { get { return FromHtml("00FF00"); } } /// /// Gets a system-defined color that has an ARGB value of #FF32CD32. /// public static Color LimeGreen { get { return FromHtml("32CD32"); } } /// /// Gets a system-defined color that has an ARGB value of #FFFAF0E6. /// public static Color Linen { get { return FromHtml("FAF0E6"); } } /// /// Gets a system-defined color that has an ARGB value of #FFFF00FF. /// public static Color Magenta { get { return FromHtml("FF00FF"); } } /// /// Gets a system-defined color that has an ARGB value of #FF800000. /// public static Color Maroon { get { return FromHtml("800000"); } } /// /// Gets a system-defined color that has an ARGB value of #FF66CDAA. /// public static Color MediumAquamarine { get { return FromHtml("66CDAA"); } } /// /// Gets a system-defined color that has an ARGB value of #FF0000CD. /// public static Color MediumBlue { get { return FromHtml("0000CD"); } } /// /// Gets a system-defined color that has an ARGB value of #FFBA55D3. /// public static Color MediumOrchid { get { return FromHtml("BA55D3"); } } /// /// Gets a system-defined color that has an ARGB value of #FF9370DB. /// public static Color MediumPurple { get { return FromHtml("9370DB"); } } /// /// Gets a system-defined color that has an ARGB value of #FF3CB371. /// public static Color MediumSeaGreen { get { return FromHtml("3CB371"); } } /// /// Gets a system-defined color that has an ARGB value of #FF7B68EE. /// public static Color MediumSlateBlue { get { return FromHtml("7B68EE"); } } /// /// Gets a system-defined color that has an ARGB value of #FF00FA9A. /// public static Color MediumSpringGreen { get { return FromHtml("00FA9A"); } } /// /// Gets a system-defined color that has an ARGB value of #FF48D1CC. /// public static Color MediumTurquoise { get { return FromHtml("48D1CC"); } } /// /// Gets a system-defined color that has an ARGB value of #FFC71585. /// public static Color MediumVioletRed { get { return FromHtml("C71585"); } } /// /// Gets a system-defined color that has an ARGB value of #FF191970. /// public static Color MidnightBlue { get { return FromHtml("191970"); } } /// /// Gets a system-defined color that has an ARGB value of #FFF5FFFA. /// public static Color MintCream { get { return FromHtml("F5FFFA"); } } /// /// Gets a system-defined color that has an ARGB value of #FFFFE4E1. /// public static Color MistyRose { get { return FromHtml("FFE4E1"); } } /// /// Gets a system-defined color that has an ARGB value of #FFFFE4B5. /// public static Color Moccasin { get { return FromHtml("FFE4B5"); } } /// /// Gets a system-defined color that has an ARGB value of #FFFFDEAD. /// public static Color NavajoWhite { get { return FromHtml("FFDEAD"); } } /// /// Gets a system-defined color that has an ARGB value of #FF000080. /// public static Color Navy { get { return FromHtml("000080"); } } /// /// Gets a system-defined color that has an ARGB value of #FFFDF5E6. /// public static Color OldLace { get { return FromHtml("FDF5E6"); } } /// /// Gets a system-defined color that has an ARGB value of #FF808000. /// public static Color Olive { get { return FromHtml("808000"); } } /// /// Gets a system-defined color that has an ARGB value of #FF6B8E23. /// public static Color OliveDrab { get { return FromHtml("6B8E23"); } } /// /// Gets a system-defined color that has an ARGB value of #FFFFA500. /// public static Color Orange { get { return FromHtml("FFA500"); } } /// /// Gets a system-defined color that has an ARGB value of #FFFF4500. /// public static Color OrangeRed { get { return FromHtml("FF4500"); } } /// /// Gets a system-defined color that has an ARGB value of #FFDA70D6. /// public static Color Orchid { get { return FromHtml("DA70D6"); } } /// /// Gets a system-defined color that has an ARGB value of #FFEEE8AA. /// public static Color PaleGoldenrod { get { return FromHtml("EEE8AA"); } } /// /// Gets a system-defined color that has an ARGB value of #FF98FB98. /// public static Color PaleGreen { get { return FromHtml("98FB98"); } } /// /// Gets a system-defined color that has an ARGB value of #FFAFEEEE. /// public static Color PaleTurquoise { get { return FromHtml("AFEEEE"); } } /// /// Gets a system-defined color that has an ARGB value of #FFDB7093. /// public static Color PaleVioletRed { get { return FromHtml("DB7093"); } } /// /// Gets a system-defined color that has an ARGB value of #FFFFEFD5. /// public static Color PapayaWhip { get { return FromHtml("FFEFD5"); } } /// /// Gets a system-defined color that has an ARGB value of #FFFFDAB9. /// public static Color PeachPuff { get { return FromHtml("FFDAB9"); } } /// /// Gets a system-defined color that has an ARGB value of #FFCD853F. /// public static Color Peru { get { return FromHtml("CD853F"); } } /// /// Gets a system-defined color that has an ARGB value of #FFFFC0CB. /// public static Color Pink { get { return FromHtml("FFC0CB"); } } /// /// Gets a system-defined color that has an ARGB value of #FFDDA0DD. /// public static Color Plum { get { return FromHtml("DDA0DD"); } } /// /// Gets a system-defined color that has an ARGB value of #FFB0E0E6. /// public static Color PowderBlue { get { return FromHtml("B0E0E6"); } } /// /// Gets a system-defined color that has an ARGB value of #FF800080. /// public static Color Purple { get { return FromHtml("800080"); } } /// /// Gets a system-defined color that has an ARGB value of #FFFF0000. /// public static Color Red { get { return FromHtml("FF0000"); } } /// /// Gets a system-defined color that has an ARGB value of #FFBC8F8F. /// public static Color RosyBrown { get { return FromHtml("BC8F8F"); } } /// /// Gets a system-defined color that has an ARGB value of #FF4169E1. /// public static Color RoyalBlue { get { return FromHtml("4169E1"); } } /// /// Gets a system-defined color that has an ARGB value of #FF8B4513. /// public static Color SaddleBrown { get { return FromHtml("8B4513"); } } /// /// Gets a system-defined color that has an ARGB value of #FFFA8072. /// public static Color Salmon { get { return FromHtml("FA8072"); } } /// /// Gets a system-defined color that has an ARGB value of #FFF4A460. /// public static Color SandyBrown { get { return FromHtml("F4A460"); } } /// /// Gets a system-defined color that has an ARGB value of #FF2E8B57. /// public static Color SeaGreen { get { return FromHtml("2E8B57"); } } /// /// Gets a system-defined color that has an ARGB value of #FFFFF5EE. /// public static Color SeaShell { get { return FromHtml("FFF5EE"); } } /// /// Gets a system-defined color that has an ARGB value of #FFA0522D. /// public static Color Sienna { get { return FromHtml("A0522D"); } } /// /// Gets a system-defined color that has an ARGB value of #FFC0C0C0. /// public static Color Silver { get { return FromHtml("C0C0C0"); } } /// /// Gets a system-defined color that has an ARGB value of #FF87CEEB. /// public static Color SkyBlue { get { return FromHtml("87CEEB"); } } /// /// Gets a system-defined color that has an ARGB value of #FF6A5ACD. /// public static Color SlateBlue { get { return FromHtml("6A5ACD"); } } /// /// Gets a system-defined color that has an ARGB value of #FF708090. /// public static Color SlateGray { get { return FromHtml("708090"); } } /// /// Gets a system-defined color that has an ARGB value of #FFFFFAFA. /// public static Color Snow { get { return FromHtml("FFFAFA"); } } /// /// Gets a system-defined color that has an ARGB value of #FF00FF7F. /// public static Color SpringGreen { get { return FromHtml("00FF7F"); } } /// /// Gets a system-defined color that has an ARGB value of #FF4682B4. /// public static Color SteelBlue { get { return FromHtml("4682B4"); } } /// /// Gets a system-defined color that has an ARGB value of #FFD2B48C. /// public static Color Tan { get { return FromHtml("D2B48C"); } } /// /// Gets a system-defined color that has an ARGB value of #FF008080. /// public static Color Teal { get { return FromHtml("008080"); } } /// /// Gets a system-defined color that has an ARGB value of #FFD8BFD8. /// public static Color Thistle { get { return FromHtml("D8BFD8"); } } /// /// Gets a system-defined color that has an ARGB value of #FFFF6347. /// public static Color Tomato { get { return FromHtml("FF6347"); } } /// /// Gets a system-defined color that has an ARGB value of #00000000. /// public static Color Transparent { get { return FromArgb(0, 0, 0, 0); } } /// /// Gets a system-defined color that has an ARGB value of #FF40E0D0. /// public static Color Turquoise { get { return FromHtml("40E0D0"); } } /// /// Gets a system-defined color that has an ARGB value of #FFEE82EE. /// public static Color Violet { get { return FromHtml("EE82EE"); } } /// /// Gets a system-defined color that has an ARGB value of #FFF5DEB3. /// public static Color Wheat { get { return FromHtml("F5DEB3"); } } /// /// Gets a system-defined color that has an ARGB value of #FFFFFFFF. /// public static Color White { get { return FromHtml("FFFFFF"); } } /// /// Gets a system-defined color that has an ARGB value of #FFF5F5F5. /// public static Color WhiteSmoke { get { return FromHtml("F5F5F5"); } } /// /// Gets a system-defined color that has an ARGB value of #FFFFFF00. /// public static Color Yellow { get { return FromHtml("FFFF00"); } } /// /// Gets a system-defined color that has an ARGB value of #FF9ACD32. /// public static Color YellowGreen { get { return FromHtml("9ACD32"); } } #endregion #region Enums /// /// Car colors. /// public enum CarColor : int { Salmon = 130, Jade = 131, PalePistachio = 132, ElectricBlue = 142, TurquoiseBlue = 144, }; #endregion }; };