2

I am programming with C# in VisualStudio and I got Colors given in hex string format. fex. "#D8AE6D". I want to quickly preview the color, so I know what the code stands for. For HTML/CSS there are many solutions. But I found non for usual C# code.

Is there a tool or addon that is recommended or even a built in solution?

Mechandrius
  • 323
  • 2
  • 12
  • Check [this](https://stackoverflow.com/questions/2109756/how-do-i-get-the-color-from-a-hexadecimal-color-code-using-net). –  Jan 26 '20 at 16:45
  • I think you misunderstood. I want to actually see the color from Hex, not converting it to another format – Mechandrius Jan 26 '20 at 19:37
  • I see. Then what platform? WinForms, WPF, UWP? –  Jan 26 '20 at 23:00
  • Its in string Hex like in my question. Its the c# .net framework .. is there a marketplace addon for this or is there an inbuilt solution, since for html/css there is a possibility I think – Mechandrius Jan 27 '20 at 01:00

1 Answers1

1

If you want to preview the color from hex, I suggest that you could make the color as the picturebox balckcolor.

Like the following:

private void Form1_Load(object sender, EventArgs e)
        {
            Color color = ColorTranslator.FromHtml("#D8AE6D");
            pictureBox1.BackColor = color;
        }

Result: enter image description here

Jack J Jun
  • 5,633
  • 1
  • 9
  • 27
  • Can you please elaborate when I can call/use your solution? I am looking for an "DevelopmentTime"/"EditorTime"-Solution, not runtime. – Mechandrius Mar 10 '20 at 12:36