static void Main(string[] args) { Console.WriteLine("ColorHash > Hello World"); var colorHash = new ColorHash(); //HSL (return HSL object) var hsl = colorHash.Hsl("Hello World"); Console.WriteLine($" H = {hsl.H} | S = {hsl.S} | L = {hsl.L}"); Debug.WriteLine($" H = {hsl.H} | S = {hsl.S} | L = {hsl.L}"); //RGB (return System.Drawing.Color object) var color = colorHash.Rgb("Hello World"); Console.WriteLine($" R= {color.R} | G = {color.G} | B = {color.B}"); Debug.WriteLine($" R= {color.R} | G = {color.G} | B = {color.B}"); //Hex (return string) var hex = colorHash.Hex("Hello World"); Console.WriteLine($" hex = {hex}"); Debug.WriteLine($" hex = {hex}"); Console.WriteLine("Press any key to close..."); Console.ReadKey(); }
public EntityBubble(Entity entity, string?backgroundColorOn = null) { BackgroundColor = backgroundColorOn ?? ColorHash.HEX(entity.Id); Entity = entity; Name = entity.Name; Icon = entity.Icon; Entity.EntityChanged += () => { OnEntityChangedInternal(); InvokeBubbleChanged(); }; OnEntityChangedInternal(); }
public void ReadmeCodeExample_ToCopyPaste() { Debug.WriteLine($"ColorHash > Hello World"); var colorHash = new ColorHash(); //HSL (return HSL object) var hsl = colorHash.Hsl("Hello World"); Debug.WriteLine($" H = {hsl.H} | S = {hsl.S} | L = {hsl.L}"); //RGB (return System.Drawing.Color object) var color = colorHash.Rgb("Hello World"); Debug.WriteLine($" R= {color.R} | G = {color.G} | B = {color.B}"); //Hex (return string) var hex = colorHash.Hex("Hello World"); Debug.WriteLine($" hex = {hex}"); }