using System; using System.Collections.Generic; using System.Linq; namespace Chernobyl.Graphics { /// /// Represents a color with red, green, blue, and alpha components or channels. /// [Serializable] public struct ColorRgba : IEquatable, IComparable { /// A value between 0 and 255 representing the red component of the color. /// A value between 0 and 255 representing the green component of the color. /// A value between 0 and 255 representing the green component of the color. public ColorRgba(byte red, byte green, byte blue) : this(red, green, blue, (byte)MaxChannelByteValue) {} /// A value between 0.0 and 1.0 representing the red component of the color. /// A value between 0.0 and 1.0 representing the green component of the color. /// A value between 0.0 and 1.0 representing the green component of the color. /// A value between 0.0 and 1.0 representing the alpha component of the color. public ColorRgba(float red, float green, float blue, float alpha) : this(ColorFloatToByte(red), ColorFloatToByte(green), ColorFloatToByte(blue), ColorFloatToByte(alpha)) {} /// A value between 0.0 and 1.0 representing the red component of the color. /// A value between 0.0 and 1.0 representing the green component of the color. /// A value between 0.0 and 1.0 representing the green component of the color. public ColorRgba(float red, float green, float blue) : this(red, green, blue, 1.0f) {} /// A value between 0 and 255 representing the red component of the color. /// A value between 0 and 255 representing the green component of the color. /// A value between 0 and 255 representing the green component of the color. /// A value between 0 and 255 representing the alpha component of the color. public ColorRgba(byte red, byte green, byte blue, byte alpha) : this() { Rgba = new[] { red, green, blue, alpha }; } /// The 0.0 to 1.0 values of each of the channels where rgba[0] /// is red, rgba[1] is green, rgba[2] is blue, and rgba[3] is alpha. /// Thrown if the length of rgba is not 4. public ColorRgba(IEnumerable rgba) : this(rgba.Select(ColorFloatToByte).ToArray()) {} /// The 0 to 255 values of each of the channels where rgba[0] /// is red, rgba[1] is green, rgba[2] is blue, and rgba[3] is alpha. /// Thrown if the length of rgba is not 4. public ColorRgba(byte[] rgba): this() { if (rgba.Length != 4) throw new ArgumentException("There must be at least four components (channels) in the passed in array", nameof(rgba)); Rgba = rgba; } /// /// Gets or sets a value between 0.0 and 255 representing the blue component or channel of /// this color. /// public byte B => Rgba[2]; /// /// Gets or sets a value between 0.0 and 255 representing the green component or channel of /// this color. /// public byte G => Rgba[1]; /// /// Gets or sets a value between 0 and 255 representing the red component or channel of /// this color. /// public byte R => Rgba[0]; /// /// Gets or sets a value between 0.0 and 255 representing the alpha component or channel of /// this color. /// public byte A => Rgba[3]; /// /// Gets color in red, green, blue, and alpha order. /// public byte[] Rgba { get; } /// /// Retrieves the color in the blue, green, red, alpha order. /// public byte[] Bgra => new[] {B, G, R, A}; /// /// Compares the values of one color to another. /// /// The color from the left side of the equality operation. /// The color from the right side of the equality operation. /// True if the values of the colors are the same, false if otherwise. public static bool operator ==(ColorRgba leftSide, ColorRgba rightSide) { return (leftSide.R == rightSide.R && leftSide.G == rightSide.G && leftSide.B == rightSide.B && leftSide.A == rightSide.A); } /// /// Compares the values of one color to another. /// /// The color from the left side of the equality operation. /// The color from the right side of the equality operation. /// True if the values of the colors are the different, false if otherwise. public static bool operator !=(ColorRgba leftSide, ColorRgba rightSide) { return !(leftSide == rightSide); } /// public bool Equals(ColorRgba other) { return (this == other); } /// public override bool Equals(object obj) { return (obj is ColorRgba color && this == color); } /// public override int GetHashCode() { return (A.GetHashCode() ^ A.GetHashCode() + R.GetHashCode() ^ R.GetHashCode() + G.GetHashCode() ^ G.GetHashCode() + B.GetHashCode() ^ B.GetHashCode()); } /// /// Converts this color into a string of this format: "{R:000 G:000 B:000 A:000}" where /// '000' is a number between 0 and 255. /// public override string ToString() { return "{R:" + R + " G:" + G + " B:" + B + " A:" + A + "}"; } /// /// Compares this color to another color and returns a signed integer /// that indicates the relative order of the two colors being compared. /// /// The color to compare to this color. /// Less than zero if this color is less than the /// color, 0 if they are equal, and greater /// than zero if the color is greater than this /// color. public int CompareTo(ColorRgba other) { var thisBytes = Rgba; var otherBytes = other.Rgba; // If the system architecture is little-endian (that is, little end first), // reverse the byte array so that the result is the same as if we were // comparing on a little endian machine. if (BitConverter.IsLittleEndian == false) { Array.Reverse(thisBytes); Array.Reverse(otherBytes); } var thisValue = BitConverter.ToInt32(thisBytes, 0); var otherValue = BitConverter.ToInt32(otherBytes, 0); return thisValue.CompareTo(otherValue); } /// /// Linear interpolates between two colors. /// /// The color to interpolate from or the source color. /// The color to interpolate to or the destination color. /// A value from 0.0 to 1.0 specifying how much weight to apply /// to the interpolation. A value closer to 0.0 will look more like /// while a color closer to 1.0 will look more like . /// The interpolated color. public static ColorRgba Lerp(ColorRgba color1, ColorRgba color2, float amount) { Lerp(out var result, color1, color2, amount); return result; } /// /// Linear interpolates between two colors. This is the exactly the same as the other /// Lerp method in this class except it takes in an out parameter for the result. Use /// this method instead of the other method if speed is a concern. /// /// The interpolated color. /// The color to interpolate from or the source color. /// The color to interpolate to or the destination color. /// A value from 0.0 to 1.0 specifying how much weight to apply /// to the interpolation. A value closer to 0.0 will look more like /// while a color closer to 1.0 will look more like . public static void Lerp(out ColorRgba result, ColorRgba color1, ColorRgba color2, float amount) { // TODO: put the lerp equation into a math library and then use that math library method here. result = new ColorRgba(color1.R + (color2.R - color1.R) * amount, color1.G + (color2.G - color1.G) * amount, color1.B + (color2.B - color1.B) * amount, color1.A + (color2.A - color1.A) * amount); } /// /// Generates a set of random colors and puts them in the /// passed in colors array. /// /// The array of colors to fill with the random /// colors /// The number of colors needed. public static void Random(out ColorRgba[] colors, uint count) { colors = new ColorRgba[count]; Random(ref colors); } /// /// Generates a set of random colors and puts them in the /// passed in colors array. /// /// The array of colors to fill with the random colors /// Thrown if does not /// have at least one color. public static void Random(ref ColorRgba[] colors) { if (colors.Length == 0) throw new ArgumentException("The passed in array of colors must have at least one color.", nameof(colors)); var numColors = (uint)colors.Length; var rand = new Random(); var numBytes = numColors * 4; var buffer = new byte[numBytes]; rand.NextBytes(buffer); uint byteCounter = 0; for (var i = 0; i < numColors; ++i) colors[i] = new ColorRgba(buffer[byteCounter++], buffer[byteCounter++], buffer[byteCounter++], buffer[byteCounter++]); } /// /// The size of the entire color structure in bytes. /// [NonSerialized] public const short ByteSize = 4; /// /// Represents the largest channel byte value there is. /// [NonSerialized] public const double MaxChannelByteValue = 255.0; /// /// Converts a floating point color component to a byte. /// public static byte ColorDoubleToByte(double value) => (byte) (value * MaxChannelByteValue); /// /// Converts a floating point color component to a byte. /// public static byte ColorFloatToByte(float value) => ColorDoubleToByte(value); /// /// Converts a byte color component to a double. /// public static double ColorByteToDouble(byte value) => value / MaxChannelByteValue; /// /// Converts a byte color component to a float. /// public static float ColorByteToFloat(byte value) => Convert.ToSingle(ColorByteToDouble(value)); #region Predefined Colors /// /// The color (205, 92, 92) in RGB. /// public static ColorRgba IndianRed => new ColorRgba(205, 92, 92); /// /// The color (240, 128, 128) in RGB. /// public static ColorRgba LightCoral => new ColorRgba(240, 128, 128); /// /// The color (250, 128, 114) in RGB. /// public static ColorRgba Salmon => new ColorRgba(250, 128, 114); /// /// The color (233, 150, 122) in RGB. /// public static ColorRgba DarkSalmon => new ColorRgba(233, 150, 122); /// /// The color (255, 160, 122) in RGB. /// public static ColorRgba LightSalmon => new ColorRgba(255, 160, 122); /// /// The color (220, 20, 60) in RGB. /// public static ColorRgba Crimson => new ColorRgba(220, 20, 60); /// /// The color (255, 0, 0) in RGB. /// public static ColorRgba Red => new ColorRgba(255, 0, 0); /// /// The color (178, 34, 34) in RGB. /// public static ColorRgba FireBrick => new ColorRgba(178, 34, 34); /// /// The color (139, 0, 0) in RGB. /// public static ColorRgba DarkRed => new ColorRgba(139, 0, 0); /// /// The color (255, 192, 203) in RGB. /// public static ColorRgba Pink => new ColorRgba(255, 192, 203); /// /// The color (255, 182, 193) in RGB. /// public static ColorRgba LightPink => new ColorRgba(255, 182, 193); /// /// The color (255, 105, 180) in RGB. /// public static ColorRgba HotPink => new ColorRgba(255, 105, 180); /// /// The color (255, 20, 147) in RGB. /// public static ColorRgba DeepPink => new ColorRgba(255, 20, 147); /// /// The color (199, 21, 133) in RGB. /// public static ColorRgba MediumVioletRed => new ColorRgba(199, 21, 133); /// /// The color (219, 112, 147) in RGB. /// public static ColorRgba PaleVioletRed => new ColorRgba(219, 112, 147); /// /// The color (255, 127, 80) in RGB. /// public static ColorRgba Coral => new ColorRgba(255, 127, 80); /// /// The color (255, 99, 71) in RGB. /// public static ColorRgba Tomato => new ColorRgba(255, 99, 71); /// /// The color (255, 69, 0) in RGB. /// public static ColorRgba OrangeRed => new ColorRgba(255, 69, 0); /// /// The color (255, 140, 0) in RGB. /// public static ColorRgba DarkOrange => new ColorRgba(255, 140, 0); /// /// The color (255, 165, 0) in RGB. /// public static ColorRgba Orange => new ColorRgba(255, 165, 0); /// /// The color (255, 215, 0) in RGB. /// public static ColorRgba Gold => new ColorRgba(255, 215, 0); /// /// The color (255, 255, 0) in RGB. /// public static ColorRgba Yellow => new ColorRgba(255, 255, 0); /// /// The color (255, 255, 224) in RGB. /// public static ColorRgba LightYellow => new ColorRgba(255, 255, 224); /// /// The color (255, 250, 205) in RGB. /// public static ColorRgba LemonChiffon => new ColorRgba(255, 250, 205); /// /// The color (250, 250, 210) in RGB. /// public static ColorRgba LightGoldenrodYellow => new ColorRgba(250, 250, 210); /// /// The color (255, 239, 213) in RGB. /// public static ColorRgba PapayaWhip => new ColorRgba(255, 239, 213); /// /// The color (255, 228, 181) in RGB. /// public static ColorRgba Moccasin => new ColorRgba(255, 228, 181); /// /// The color (255, 218, 185) in RGB. /// public static ColorRgba PeachPuff => new ColorRgba(255, 218, 185); /// /// The color (238, 232, 170) in RGB. /// public static ColorRgba PaleGoldenrod => new ColorRgba(238, 232, 170); /// /// The color (240, 230, 140) in RGB. /// public static ColorRgba Khaki => new ColorRgba(240, 230, 140); /// /// The color (189, 183, 107) in RGB. /// public static ColorRgba DarkKhaki => new ColorRgba(189, 183, 107); /// /// The color (230, 230, 250) in RGB. /// public static ColorRgba Lavender => new ColorRgba(230, 230, 250); /// /// The color (216, 191, 216) in RGB. /// public static ColorRgba Thistle => new ColorRgba(216, 191, 216); /// /// The color (221, 160, 221) in RGB. /// public static ColorRgba Plum => new ColorRgba(221, 160, 221); /// /// The color (238, 130, 238) in RGB. /// public static ColorRgba Violet => new ColorRgba(238, 130, 238); /// /// The color (218, 112, 214) in RGB. /// public static ColorRgba Orchid => new ColorRgba(218, 112, 214); /// /// The color (255, 0, 255) in RGB. /// public static ColorRgba Fuchsia => new ColorRgba(255, 0, 255); /// /// The color (255, 0, 255) in RGB. /// public static ColorRgba Magenta => new ColorRgba(255, 0, 255); /// /// The color (186, 85, 211) in RGB. /// public static ColorRgba MediumOrchid => new ColorRgba(186, 85, 211); /// /// The color (147, 112, 219) in RGB. /// public static ColorRgba MediumPurple => new ColorRgba(147, 112, 219); /// /// The color (153, 102, 204) in RGB. /// public static ColorRgba Amethyst => new ColorRgba(153, 102, 204); /// /// The color (138, 43, 226) in RGB. /// public static ColorRgba BlueViolet => new ColorRgba(138, 43, 226); /// /// The color (148, 0, 211) in RGB. /// public static ColorRgba DarkViolet => new ColorRgba(148, 0, 211); /// /// The color (153, 50, 204) in RGB. /// public static ColorRgba DarkOrchid => new ColorRgba(153, 50, 204); /// /// The color (139, 0, 139) in RGB. /// public static ColorRgba DarkMagenta => new ColorRgba(139, 0, 139); /// /// The color (128, 0, 128) in RGB. /// public static ColorRgba Purple => new ColorRgba(128, 0, 128); /// /// The color (75, 0, 130) in RGB. /// public static ColorRgba Indigo => new ColorRgba(75, 0, 130); /// /// The color (106, 90, 205) in RGB. /// public static ColorRgba SlateBlue => new ColorRgba(106, 90, 205); /// /// The color (72, 61, 139) in RGB. /// public static ColorRgba DarkSlateBlue => new ColorRgba(72, 61, 139); /// /// The color (173, 255, 47) in RGB. /// public static ColorRgba GreenYellow => new ColorRgba(173, 255, 47); /// /// The color (127, 255, 0) in RGB. /// public static ColorRgba Chartreuse => new ColorRgba(127, 255, 0); /// /// The color (124, 252, 0) in RGB. /// public static ColorRgba LawnGreen => new ColorRgba(124, 252, 0); /// /// The color (0, 255, 0) in RGB. /// public static ColorRgba Lime => new ColorRgba(0, 255, 0); /// /// The color (50, 205, 50) in RGB. /// public static ColorRgba LimeGreen => new ColorRgba(50, 205, 50); /// /// The color (152, 251, 152) in RGB. /// public static ColorRgba PaleGreen => new ColorRgba(152, 251, 152); /// /// The color (144, 238, 144) in RGB. /// public static ColorRgba LightGreen => new ColorRgba(144, 238, 144); /// /// The color (0, 250, 154) in RGB. /// public static ColorRgba MediumSpringGreen => new ColorRgba(0, 250, 154); /// /// The color (0, 255, 127) in RGB. /// public static ColorRgba SpringGreen => new ColorRgba(0, 255, 127); /// /// The color (60, 179, 113) in RGB. /// public static ColorRgba MediumSeaGreen => new ColorRgba(60, 179, 113); /// /// The color (46, 139, 87) in RGB. /// public static ColorRgba SeaGreen => new ColorRgba(46, 139, 87); /// /// The color (34, 139, 34) in RGB. /// public static ColorRgba ForestGreen => new ColorRgba(34, 139, 34); /// /// The color (0, 128, 0) in RGB. /// public static ColorRgba Green => new ColorRgba(0, 128, 0); /// /// The color (0, 100, 0) in RGB. /// public static ColorRgba DarkGreen => new ColorRgba(0, 100, 0); /// /// The color (154, 205, 50) in RGB. /// public static ColorRgba YellowGreen => new ColorRgba(154, 205, 50); /// /// The color (107, 142, 35) in RGB. /// public static ColorRgba OliveDrab => new ColorRgba(107, 142, 35); /// /// The color (128, 128, 0) in RGB. /// public static ColorRgba Olive => new ColorRgba(128, 128, 0); /// /// The color (85, 107, 47) in RGB. /// public static ColorRgba DarkOliveGreen => new ColorRgba(85, 107, 47); /// /// The color (102, 205, 170) in RGB. /// public static ColorRgba MediumAquamarine => new ColorRgba(102, 205, 170); /// /// The color (143, 188, 143) in RGB. /// public static ColorRgba DarkSeaGreen => new ColorRgba(143, 188, 143); /// /// The color (32, 178, 170) in RGB. /// public static ColorRgba LightSeaGreen => new ColorRgba(32, 178, 170); /// /// The color (0, 139, 139) in RGB. /// public static ColorRgba DarkCyan => new ColorRgba(0, 139, 139); /// /// The color (0, 128, 128) in RGB. /// public static ColorRgba Teal => new ColorRgba(0, 128, 128); /// /// The color (0, 255, 255) in RGB. /// public static ColorRgba Aqua => new ColorRgba(0, 255, 255); /// /// The color (0, 255, 255) in RGB. /// public static ColorRgba Cyan => new ColorRgba(0, 255, 255); /// /// The color (224, 255, 255) in RGB. /// public static ColorRgba LightCyan => new ColorRgba(224, 255, 255); /// /// The color (175, 238, 238) in RGB. /// public static ColorRgba PaleTurquoise => new ColorRgba(175, 238, 238); /// /// The color (127, 255, 212) in RGB. /// public static ColorRgba Aquamarine => new ColorRgba(127, 255, 212); /// /// The color (64, 224, 208) in RGB. /// public static ColorRgba Turquoise => new ColorRgba(64, 224, 208); /// /// The color (72, 209, 204) in RGB. /// public static ColorRgba MediumTurquoise => new ColorRgba(72, 209, 204); /// /// The color (0, 206, 209) in RGB. /// public static ColorRgba DarkTurquoise => new ColorRgba(0, 206, 209); /// /// The color (95, 158, 160) in RGB. /// public static ColorRgba CadetBlue => new ColorRgba(95, 158, 160); /// /// The color (70, 130, 180) in RGB. /// public static ColorRgba SteelBlue => new ColorRgba(70, 130, 180); /// /// The color (176, 196, 222) in RGB. /// public static ColorRgba LightSteelBlue => new ColorRgba(176, 196, 222); /// /// The color (176, 224, 230) in RGB. /// public static ColorRgba PowderBlue => new ColorRgba(176, 224, 230); /// /// The color (173, 216, 230) in RGB. /// public static ColorRgba LightBlue => new ColorRgba(173, 216, 230); /// /// The color (135, 206, 235) in RGB. /// public static ColorRgba SkyBlue => new ColorRgba(135, 206, 235); /// /// The color (135, 206, 250) in RGB. /// public static ColorRgba LightSkyBlue => new ColorRgba(135, 206, 250); /// /// The color (0, 191, 255) in RGB. /// public static ColorRgba DeepSkyBlue => new ColorRgba(0, 191, 255); /// /// The color (30, 144, 255) in RGB. /// public static ColorRgba DodgerBlue => new ColorRgba(30, 144, 255); /// /// The color (100, 149, 237) in RGB. /// public static ColorRgba CornflowerBlue => new ColorRgba(100, 149, 237); /// /// The color (123, 104, 238) in RGB. /// public static ColorRgba MediumSlateBlue => new ColorRgba(123, 104, 238); /// /// The color (65, 105, 225) in RGB. /// public static ColorRgba RoyalBlue => new ColorRgba(65, 105, 225); /// /// The color (0, 0, 255) in RGB. /// public static ColorRgba Blue => new ColorRgba(0, 0, 255); /// /// The color (0, 0, 205) in RGB. /// public static ColorRgba MediumBlue => new ColorRgba(0, 0, 205); /// /// The color (0, 0, 139) in RGB. /// public static ColorRgba DarkBlue => new ColorRgba(0, 0, 139); /// /// The color (0, 0, 128) in RGB. /// public static ColorRgba Navy => new ColorRgba(0, 0, 128); /// /// The color (25, 25, 112) in RGB. /// public static ColorRgba MidnightBlue => new ColorRgba(25, 25, 112); /// /// The color (255, 248, 220) in RGB. /// public static ColorRgba Cornsilk => new ColorRgba(255, 248, 220); /// /// The color (255, 235, 205) in RGB. /// public static ColorRgba BlanchedAlmond => new ColorRgba(255, 235, 205); /// /// The color (255, 228, 196) in RGB. /// public static ColorRgba Bisque => new ColorRgba(255, 228, 196); /// /// The color (255, 222, 173) in RGB. /// public static ColorRgba NavajoWhite => new ColorRgba(255, 222, 173); /// /// The color (245, 222, 179) in RGB. /// public static ColorRgba Wheat => new ColorRgba(245, 222, 179); /// /// The color (222, 184, 135) in RGB. /// public static ColorRgba BurlyWood => new ColorRgba(222, 184, 135); /// /// The color (210, 180, 140) in RGB. /// public static ColorRgba Tan => new ColorRgba(210, 180, 140); /// /// The color (188, 143, 143) in RGB. /// public static ColorRgba RosyBrown => new ColorRgba(188, 143, 143); /// /// The color (244, 164, 96) in RGB. /// public static ColorRgba SandyBrown => new ColorRgba(244, 164, 96); /// /// The color (218, 165, 32) in RGB. /// public static ColorRgba Goldenrod => new ColorRgba(218, 165, 32); /// /// The color (184, 134, 11) in RGB. /// public static ColorRgba DarkGoldenrod => new ColorRgba(184, 134, 11); /// /// The color (205, 133, 63) in RGB. /// public static ColorRgba Peru => new ColorRgba(205, 133, 63); /// /// The color (210, 105, 30) in RGB. /// public static ColorRgba Chocolate => new ColorRgba(210, 105, 30); /// /// The color (139, 69, 19) in RGB. /// public static ColorRgba SaddleBrown => new ColorRgba(139, 69, 19); /// /// The color (160, 82, 45) in RGB. /// public static ColorRgba Sienna => new ColorRgba(160, 82, 45); /// /// The color (165, 42, 42) in RGB. /// public static ColorRgba Brown => new ColorRgba(165, 42, 42); /// /// The color (128, 0, 0) in RGB. /// public static ColorRgba Maroon => new ColorRgba(128, 0, 0); /// /// The color (255, 255, 255) in RGB. /// public static ColorRgba White => new ColorRgba(255, 255, 255); /// /// The color (255, 250, 250) in RGB. /// public static ColorRgba Snow => new ColorRgba(255, 250, 250); /// /// The color (240, 255, 240) in RGB. /// public static ColorRgba Honeydew => new ColorRgba(240, 255, 240); /// /// The color (245, 255, 250) in RGB. /// public static ColorRgba MintCream => new ColorRgba(245, 255, 250); /// /// The color (240, 255, 255) in RGB. /// public static ColorRgba Azure => new ColorRgba(240, 255, 255); /// /// The color (240, 248, 255) in RGB. /// public static ColorRgba AliceBlue => new ColorRgba(240, 248, 255); /// /// The color (248, 248, 255) in RGB. /// public static ColorRgba GhostWhite => new ColorRgba(248, 248, 255); /// /// The color (245, 245, 245) in RGB. /// public static ColorRgba WhiteSmoke => new ColorRgba(245, 245, 245); /// /// The color (255, 245, 238) in RGB. /// public static ColorRgba Seashell => new ColorRgba(255, 245, 238); /// /// The color (245, 245, 220) in RGB. /// public static ColorRgba Beige => new ColorRgba(245, 245, 220); /// /// The color (253, 245, 230) in RGB. /// public static ColorRgba OldLace => new ColorRgba(253, 245, 230); /// /// The color (255, 250, 240) in RGB. /// public static ColorRgba FloralWhite => new ColorRgba(255, 250, 240); /// /// The color (255, 255, 240) in RGB. /// public static ColorRgba Ivory => new ColorRgba(255, 255, 240); /// /// The color (250, 235, 215) in RGB. /// public static ColorRgba AntiqueWhite => new ColorRgba(250, 235, 215); /// /// The color (250, 240, 230) in RGB. /// public static ColorRgba Linen => new ColorRgba(250, 240, 230); /// /// The color (255, 240, 245) in RGB. /// public static ColorRgba LavenderBlush => new ColorRgba(255, 240, 245); /// /// The color (255, 228, 225) in RGB. /// public static ColorRgba MistyRose => new ColorRgba(255, 228, 225); /// /// The color (220, 220, 220) in RGB. /// public static ColorRgba Gainsboro => new ColorRgba(220, 220, 220); /// /// The color (211, 211, 211) in RGB. /// public static ColorRgba LightGrey => new ColorRgba(211, 211, 211); /// /// The color (192, 192, 192) in RGB. /// public static ColorRgba Silver => new ColorRgba(192, 192, 192); /// /// The color (169, 169, 169) in RGB. /// public static ColorRgba DarkGray => new ColorRgba(169, 169, 169); /// /// The color (128, 128, 128) in RGB. /// public static ColorRgba Gray => new ColorRgba(128, 128, 128); /// /// The color (105, 105, 105) in RGB. /// public static ColorRgba DimGray => new ColorRgba(105, 105, 105); /// /// The color (119, 136, 153) in RGB. /// public static ColorRgba LightSlateGray => new ColorRgba(119, 136, 153); /// /// The color (112, 128, 144) in RGB. /// public static ColorRgba SlateGray => new ColorRgba(112, 128, 144); /// /// The color (47, 79, 79) in RGB. /// public static ColorRgba DarkSlateGray => new ColorRgba(47, 79, 79); /// /// The color (0, 0, 0) in RGB. /// public static ColorRgba Black => new ColorRgba(0, 0, 0); #endregion // Predefined Colors } }