Skip to content

Instantly share code, notes, and snippets.

@wappenull
Last active August 1, 2024 00:29
Show Gist options
  • Save wappenull/a22f297dc11b8729b1ee88a0ec41bd60 to your computer and use it in GitHub Desktop.
Save wappenull/a22f297dc11b8729b1ee88a0ec41bd60 to your computer and use it in GitHub Desktop.
List of HTML color names for UnityEngine Color
using UnityEngine;
namespace Wappen
{
/// <summary>
/// List of HTML color names for UnityEngine Color.
/// </summary>
/// <remarks>
/// Extracted from https://www.w3schools.com/colors/colors_hex.asp
///
/// It is can be used for both runtime and initialization such as
/// [SerializeField] Color m_FoodColor = HtmlColors.Orange;
/// </remarks>
public static class HtmlColors
{
// Note: Cannot use ColorUtility.TryParseHtmlString on ctor timing because following error:
// UnityException: DoTryParseHtmlColor is not allowed to be called from a MonoBehaviour constructor (or instance field initializer), call it in Awake or Start instead. Called from MonoBehaviour 'DamageIndicator' on game object 'DmgIndicator'.
// See "Script Serialization" page in the Unity Manual for further details.
// So each color has to be initialized manually
public static readonly Color Black = new Color( 0x00/255.0f, 0x00/255.0f, 0x00/255.0f ); // #000000
public static readonly Color Navy = new Color( 0x00/255.0f, 0x00/255.0f, 0x80/255.0f ); // #000080
public static readonly Color DarkBlue = new Color( 0x00/255.0f, 0x00/255.0f, 0x8B/255.0f ); // #00008B
public static readonly Color MediumBlue = new Color( 0x00/255.0f, 0x00/255.0f, 0xCD/255.0f ); // #0000CD
public static readonly Color Blue = new Color( 0x00/255.0f, 0x00/255.0f, 0xFF/255.0f ); // #0000FF
public static readonly Color DarkGreen = new Color( 0x00/255.0f, 0x64/255.0f, 0x00/255.0f ); // #006400
public static readonly Color Green = new Color( 0x00/255.0f, 0x80/255.0f, 0x00/255.0f ); // #008000
public static readonly Color Teal = new Color( 0x00/255.0f, 0x80/255.0f, 0x80/255.0f ); // #008080
public static readonly Color DarkCyan = new Color( 0x00/255.0f, 0x8B/255.0f, 0x8B/255.0f ); // #008B8B
public static readonly Color DeepSkyBlue = new Color( 0x00/255.0f, 0xBF/255.0f, 0xFF/255.0f ); // #00BFFF
public static readonly Color DarkTurquoise = new Color( 0x00/255.0f, 0xCE/255.0f, 0xD1/255.0f ); // #00CED1
public static readonly Color MediumSpringGreen = new Color( 0x00/255.0f, 0xFA/255.0f, 0x9A/255.0f ); // #00FA9A
public static readonly Color Lime = new Color( 0x00/255.0f, 0xFF/255.0f, 0x00/255.0f ); // #00FF00
public static readonly Color SpringGreen = new Color( 0x00/255.0f, 0xFF/255.0f, 0x7F/255.0f ); // #00FF7F
public static readonly Color Aqua = new Color( 0x00/255.0f, 0xFF/255.0f, 0xFF/255.0f ); // #00FFFF
public static readonly Color Cyan = new Color( 0x00/255.0f, 0xFF/255.0f, 0xFF/255.0f ); // #00FFFF
public static readonly Color MidnightBlue = new Color( 0x19/255.0f, 0x19/255.0f, 0x70/255.0f ); // #191970
public static readonly Color DodgerBlue = new Color( 0x1E/255.0f, 0x90/255.0f, 0xFF/255.0f ); // #1E90FF
public static readonly Color LightSeaGreen = new Color( 0x20/255.0f, 0xB2/255.0f, 0xAA/255.0f ); // #20B2AA
public static readonly Color ForestGreen = new Color( 0x22/255.0f, 0x8B/255.0f, 0x22/255.0f ); // #228B22
public static readonly Color SeaGreen = new Color( 0x2E/255.0f, 0x8B/255.0f, 0x57/255.0f ); // #2E8B57
public static readonly Color DarkSlateGray = new Color( 0x2F/255.0f, 0x4F/255.0f, 0x4F/255.0f ); // #2F4F4F
public static readonly Color DarkSlateGrey = new Color( 0x2F/255.0f, 0x4F/255.0f, 0x4F/255.0f ); // #2F4F4F
public static readonly Color LimeGreen = new Color( 0x32/255.0f, 0xCD/255.0f, 0x32/255.0f ); // #32CD32
public static readonly Color MediumSeaGreen = new Color( 0x3C/255.0f, 0xB3/255.0f, 0x71/255.0f ); // #3CB371
public static readonly Color Turquoise = new Color( 0x40/255.0f, 0xE0/255.0f, 0xD0/255.0f ); // #40E0D0
public static readonly Color RoyalBlue = new Color( 0x41/255.0f, 0x69/255.0f, 0xE1/255.0f ); // #4169E1
public static readonly Color SteelBlue = new Color( 0x46/255.0f, 0x82/255.0f, 0xB4/255.0f ); // #4682B4
public static readonly Color DarkSlateBlue = new Color( 0x48/255.0f, 0x3D/255.0f, 0x8B/255.0f ); // #483D8B
public static readonly Color MediumTurquoise = new Color( 0x48/255.0f, 0xD1/255.0f, 0xCC/255.0f ); // #48D1CC
public static readonly Color Indigo = new Color( 0x4B/255.0f, 0x00/255.0f, 0x82/255.0f ); // #4B0082
public static readonly Color DarkOliveGreen = new Color( 0x55/255.0f, 0x6B/255.0f, 0x2F/255.0f ); // #556B2F
public static readonly Color CadetBlue = new Color( 0x5F/255.0f, 0x9E/255.0f, 0xA0/255.0f ); // #5F9EA0
public static readonly Color CornflowerBlue = new Color( 0x64/255.0f, 0x95/255.0f, 0xED/255.0f ); // #6495ED
public static readonly Color RebeccaPurple = new Color( 0x66/255.0f, 0x33/255.0f, 0x99/255.0f ); // #663399
public static readonly Color MediumAquaMarine = new Color( 0x66/255.0f, 0xCD/255.0f, 0xAA/255.0f ); // #66CDAA
public static readonly Color DimGray = new Color( 0x69/255.0f, 0x69/255.0f, 0x69/255.0f ); // #696969
public static readonly Color DimGrey = new Color( 0x69/255.0f, 0x69/255.0f, 0x69/255.0f ); // #696969
public static readonly Color SlateBlue = new Color( 0x6A/255.0f, 0x5A/255.0f, 0xCD/255.0f ); // #6A5ACD
public static readonly Color OliveDrab = new Color( 0x6B/255.0f, 0x8E/255.0f, 0x23/255.0f ); // #6B8E23
public static readonly Color SlateGray = new Color( 0x70/255.0f, 0x80/255.0f, 0x90/255.0f ); // #708090
public static readonly Color SlateGrey = new Color( 0x70/255.0f, 0x80/255.0f, 0x90/255.0f ); // #708090
public static readonly Color LightSlateGray = new Color( 0x77/255.0f, 0x88/255.0f, 0x99/255.0f ); // #778899
public static readonly Color LightSlateGrey = new Color( 0x77/255.0f, 0x88/255.0f, 0x99/255.0f ); // #778899
public static readonly Color MediumSlateBlue = new Color( 0x7B/255.0f, 0x68/255.0f, 0xEE/255.0f ); // #7B68EE
public static readonly Color LawnGreen = new Color( 0x7C/255.0f, 0xFC/255.0f, 0x00/255.0f ); // #7CFC00
public static readonly Color Chartreuse = new Color( 0x7F/255.0f, 0xFF/255.0f, 0x00/255.0f ); // #7FFF00
public static readonly Color Aquamarine = new Color( 0x7F/255.0f, 0xFF/255.0f, 0xD4/255.0f ); // #7FFFD4
public static readonly Color Maroon = new Color( 0x80/255.0f, 0x00/255.0f, 0x00/255.0f ); // #800000
public static readonly Color Purple = new Color( 0x80/255.0f, 0x00/255.0f, 0x80/255.0f ); // #800080
public static readonly Color Olive = new Color( 0x80/255.0f, 0x80/255.0f, 0x00/255.0f ); // #808000
public static readonly Color Gray = new Color( 0x80/255.0f, 0x80/255.0f, 0x80/255.0f ); // #808080
public static readonly Color Grey = new Color( 0x80/255.0f, 0x80/255.0f, 0x80/255.0f ); // #808080
public static readonly Color SkyBlue = new Color( 0x87/255.0f, 0xCE/255.0f, 0xEB/255.0f ); // #87CEEB
public static readonly Color LightSkyBlue = new Color( 0x87/255.0f, 0xCE/255.0f, 0xFA/255.0f ); // #87CEFA
public static readonly Color BlueViolet = new Color( 0x8A/255.0f, 0x2B/255.0f, 0xE2/255.0f ); // #8A2BE2
public static readonly Color DarkRed = new Color( 0x8B/255.0f, 0x00/255.0f, 0x00/255.0f ); // #8B0000
public static readonly Color DarkMagenta = new Color( 0x8B/255.0f, 0x00/255.0f, 0x8B/255.0f ); // #8B008B
public static readonly Color SaddleBrown = new Color( 0x8B/255.0f, 0x45/255.0f, 0x13/255.0f ); // #8B4513
public static readonly Color DarkSeaGreen = new Color( 0x8F/255.0f, 0xBC/255.0f, 0x8F/255.0f ); // #8FBC8F
public static readonly Color LightGreen = new Color( 0x90/255.0f, 0xEE/255.0f, 0x90/255.0f ); // #90EE90
public static readonly Color MediumPurple = new Color( 0x93/255.0f, 0x70/255.0f, 0xDB/255.0f ); // #9370DB
public static readonly Color DarkViolet = new Color( 0x94/255.0f, 0x00/255.0f, 0xD3/255.0f ); // #9400D3
public static readonly Color PaleGreen = new Color( 0x98/255.0f, 0xFB/255.0f, 0x98/255.0f ); // #98FB98
public static readonly Color DarkOrchid = new Color( 0x99/255.0f, 0x32/255.0f, 0xCC/255.0f ); // #9932CC
public static readonly Color YellowGreen = new Color( 0x9A/255.0f, 0xCD/255.0f, 0x32/255.0f ); // #9ACD32
public static readonly Color Sienna = new Color( 0xA0/255.0f, 0x52/255.0f, 0x2D/255.0f ); // #A0522D
public static readonly Color Brown = new Color( 0xA5/255.0f, 0x2A/255.0f, 0x2A/255.0f ); // #A52A2A
public static readonly Color DarkGray = new Color( 0xA9/255.0f, 0xA9/255.0f, 0xA9/255.0f ); // #A9A9A9
public static readonly Color DarkGrey = new Color( 0xA9/255.0f, 0xA9/255.0f, 0xA9/255.0f ); // #A9A9A9
public static readonly Color LightBlue = new Color( 0xAD/255.0f, 0xD8/255.0f, 0xE6/255.0f ); // #ADD8E6
public static readonly Color GreenYellow = new Color( 0xAD/255.0f, 0xFF/255.0f, 0x2F/255.0f ); // #ADFF2F
public static readonly Color PaleTurquoise = new Color( 0xAF/255.0f, 0xEE/255.0f, 0xEE/255.0f ); // #AFEEEE
public static readonly Color LightSteelBlue = new Color( 0xB0/255.0f, 0xC4/255.0f, 0xDE/255.0f ); // #B0C4DE
public static readonly Color PowderBlue = new Color( 0xB0/255.0f, 0xE0/255.0f, 0xE6/255.0f ); // #B0E0E6
public static readonly Color FireBrick = new Color( 0xB2/255.0f, 0x22/255.0f, 0x22/255.0f ); // #B22222
public static readonly Color DarkGoldenRod = new Color( 0xB8/255.0f, 0x86/255.0f, 0x0B/255.0f ); // #B8860B
public static readonly Color MediumOrchid = new Color( 0xBA/255.0f, 0x55/255.0f, 0xD3/255.0f ); // #BA55D3
public static readonly Color RosyBrown = new Color( 0xBC/255.0f, 0x8F/255.0f, 0x8F/255.0f ); // #BC8F8F
public static readonly Color DarkKhaki = new Color( 0xBD/255.0f, 0xB7/255.0f, 0x6B/255.0f ); // #BDB76B
public static readonly Color Silver = new Color( 0xC0/255.0f, 0xC0/255.0f, 0xC0/255.0f ); // #C0C0C0
public static readonly Color MediumVioletRed = new Color( 0xC7/255.0f, 0x15/255.0f, 0x85/255.0f ); // #C71585
public static readonly Color IndianRed = new Color( 0xCD/255.0f, 0x5C/255.0f, 0x5C/255.0f ); // #CD5C5C
public static readonly Color Peru = new Color( 0xCD/255.0f, 0x85/255.0f, 0x3F/255.0f ); // #CD853F
public static readonly Color Chocolate = new Color( 0xD2/255.0f, 0x69/255.0f, 0x1E/255.0f ); // #D2691E
public static readonly Color Tan = new Color( 0xD2/255.0f, 0xB4/255.0f, 0x8C/255.0f ); // #D2B48C
public static readonly Color LightGray = new Color( 0xD3/255.0f, 0xD3/255.0f, 0xD3/255.0f ); // #D3D3D3
public static readonly Color LightGrey = new Color( 0xD3/255.0f, 0xD3/255.0f, 0xD3/255.0f ); // #D3D3D3
public static readonly Color Thistle = new Color( 0xD8/255.0f, 0xBF/255.0f, 0xD8/255.0f ); // #D8BFD8
public static readonly Color Orchid = new Color( 0xDA/255.0f, 0x70/255.0f, 0xD6/255.0f ); // #DA70D6
public static readonly Color GoldenRod = new Color( 0xDA/255.0f, 0xA5/255.0f, 0x20/255.0f ); // #DAA520
public static readonly Color PaleVioletRed = new Color( 0xDB/255.0f, 0x70/255.0f, 0x93/255.0f ); // #DB7093
public static readonly Color Crimson = new Color( 0xDC/255.0f, 0x14/255.0f, 0x3C/255.0f ); // #DC143C
public static readonly Color Gainsboro = new Color( 0xDC/255.0f, 0xDC/255.0f, 0xDC/255.0f ); // #DCDCDC
public static readonly Color Plum = new Color( 0xDD/255.0f, 0xA0/255.0f, 0xDD/255.0f ); // #DDA0DD
public static readonly Color BurlyWood = new Color( 0xDE/255.0f, 0xB8/255.0f, 0x87/255.0f ); // #DEB887
public static readonly Color LightCyan = new Color( 0xE0/255.0f, 0xFF/255.0f, 0xFF/255.0f ); // #E0FFFF
public static readonly Color Lavender = new Color( 0xE6/255.0f, 0xE6/255.0f, 0xFA/255.0f ); // #E6E6FA
public static readonly Color DarkSalmon = new Color( 0xE9/255.0f, 0x96/255.0f, 0x7A/255.0f ); // #E9967A
public static readonly Color Violet = new Color( 0xEE/255.0f, 0x82/255.0f, 0xEE/255.0f ); // #EE82EE
public static readonly Color PaleGoldenRod = new Color( 0xEE/255.0f, 0xE8/255.0f, 0xAA/255.0f ); // #EEE8AA
public static readonly Color LightCoral = new Color( 0xF0/255.0f, 0x80/255.0f, 0x80/255.0f ); // #F08080
public static readonly Color Khaki = new Color( 0xF0/255.0f, 0xE6/255.0f, 0x8C/255.0f ); // #F0E68C
public static readonly Color AliceBlue = new Color( 0xF0/255.0f, 0xF8/255.0f, 0xFF/255.0f ); // #F0F8FF
public static readonly Color HoneyDew = new Color( 0xF0/255.0f, 0xFF/255.0f, 0xF0/255.0f ); // #F0FFF0
public static readonly Color Azure = new Color( 0xF0/255.0f, 0xFF/255.0f, 0xFF/255.0f ); // #F0FFFF
public static readonly Color SandyBrown = new Color( 0xF4/255.0f, 0xA4/255.0f, 0x60/255.0f ); // #F4A460
public static readonly Color Wheat = new Color( 0xF5/255.0f, 0xDE/255.0f, 0xB3/255.0f ); // #F5DEB3
public static readonly Color Beige = new Color( 0xF5/255.0f, 0xF5/255.0f, 0xDC/255.0f ); // #F5F5DC
public static readonly Color WhiteSmoke = new Color( 0xF5/255.0f, 0xF5/255.0f, 0xF5/255.0f ); // #F5F5F5
public static readonly Color MintCream = new Color( 0xF5/255.0f, 0xFF/255.0f, 0xFA/255.0f ); // #F5FFFA
public static readonly Color GhostWhite = new Color( 0xF8/255.0f, 0xF8/255.0f, 0xFF/255.0f ); // #F8F8FF
public static readonly Color Salmon = new Color( 0xFA/255.0f, 0x80/255.0f, 0x72/255.0f ); // #FA8072
public static readonly Color AntiqueWhite = new Color( 0xFA/255.0f, 0xEB/255.0f, 0xD7/255.0f ); // #FAEBD7
public static readonly Color Linen = new Color( 0xFA/255.0f, 0xF0/255.0f, 0xE6/255.0f ); // #FAF0E6
public static readonly Color LightGoldenRodYellow = new Color( 0xFA/255.0f, 0xFA/255.0f, 0xD2/255.0f ); // #FAFAD2
public static readonly Color OldLace = new Color( 0xFD/255.0f, 0xF5/255.0f, 0xE6/255.0f ); // #FDF5E6
public static readonly Color Red = new Color( 0xFF/255.0f, 0x00/255.0f, 0x00/255.0f ); // #FF0000
public static readonly Color Fuchsia = new Color( 0xFF/255.0f, 0x00/255.0f, 0xFF/255.0f ); // #FF00FF
public static readonly Color Magenta = new Color( 0xFF/255.0f, 0x00/255.0f, 0xFF/255.0f ); // #FF00FF
public static readonly Color DeepPink = new Color( 0xFF/255.0f, 0x14/255.0f, 0x93/255.0f ); // #FF1493
public static readonly Color OrangeRed = new Color( 0xFF/255.0f, 0x45/255.0f, 0x00/255.0f ); // #FF4500
public static readonly Color Tomato = new Color( 0xFF/255.0f, 0x63/255.0f, 0x47/255.0f ); // #FF6347
public static readonly Color HotPink = new Color( 0xFF/255.0f, 0x69/255.0f, 0xB4/255.0f ); // #FF69B4
public static readonly Color Coral = new Color( 0xFF/255.0f, 0x7F/255.0f, 0x50/255.0f ); // #FF7F50
public static readonly Color DarkOrange = new Color( 0xFF/255.0f, 0x8C/255.0f, 0x00/255.0f ); // #FF8C00
public static readonly Color LightSalmon = new Color( 0xFF/255.0f, 0xA0/255.0f, 0x7A/255.0f ); // #FFA07A
public static readonly Color Orange = new Color( 0xFF/255.0f, 0xA5/255.0f, 0x00/255.0f ); // #FFA500
public static readonly Color LightPink = new Color( 0xFF/255.0f, 0xB6/255.0f, 0xC1/255.0f ); // #FFB6C1
public static readonly Color Pink = new Color( 0xFF/255.0f, 0xC0/255.0f, 0xCB/255.0f ); // #FFC0CB
public static readonly Color Gold = new Color( 0xFF/255.0f, 0xD7/255.0f, 0x00/255.0f ); // #FFD700
public static readonly Color PeachPuff = new Color( 0xFF/255.0f, 0xDA/255.0f, 0xB9/255.0f ); // #FFDAB9
public static readonly Color NavajoWhite = new Color( 0xFF/255.0f, 0xDE/255.0f, 0xAD/255.0f ); // #FFDEAD
public static readonly Color Moccasin = new Color( 0xFF/255.0f, 0xE4/255.0f, 0xB5/255.0f ); // #FFE4B5
public static readonly Color Bisque = new Color( 0xFF/255.0f, 0xE4/255.0f, 0xC4/255.0f ); // #FFE4C4
public static readonly Color MistyRose = new Color( 0xFF/255.0f, 0xE4/255.0f, 0xE1/255.0f ); // #FFE4E1
public static readonly Color BlanchedAlmond = new Color( 0xFF/255.0f, 0xEB/255.0f, 0xCD/255.0f ); // #FFEBCD
public static readonly Color PapayaWhip = new Color( 0xFF/255.0f, 0xEF/255.0f, 0xD5/255.0f ); // #FFEFD5
public static readonly Color LavenderBlush = new Color( 0xFF/255.0f, 0xF0/255.0f, 0xF5/255.0f ); // #FFF0F5
public static readonly Color SeaShell = new Color( 0xFF/255.0f, 0xF5/255.0f, 0xEE/255.0f ); // #FFF5EE
public static readonly Color Cornsilk = new Color( 0xFF/255.0f, 0xF8/255.0f, 0xDC/255.0f ); // #FFF8DC
public static readonly Color LemonChiffon = new Color( 0xFF/255.0f, 0xFA/255.0f, 0xCD/255.0f ); // #FFFACD
public static readonly Color FloralWhite = new Color( 0xFF/255.0f, 0xFA/255.0f, 0xF0/255.0f ); // #FFFAF0
public static readonly Color Snow = new Color( 0xFF/255.0f, 0xFA/255.0f, 0xFA/255.0f ); // #FFFAFA
public static readonly Color Yellow = new Color( 0xFF/255.0f, 0xFF/255.0f, 0x00/255.0f ); // #FFFF00
public static readonly Color LightYellow = new Color( 0xFF/255.0f, 0xFF/255.0f, 0xE0/255.0f ); // #FFFFE0
public static readonly Color Ivory = new Color( 0xFF/255.0f, 0xFF/255.0f, 0xF0/255.0f ); // #FFFFF0
public static readonly Color White = new Color( 0xFF/255.0f, 0xFF/255.0f, 0xFF/255.0f ); // #FFFFFF
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment