Visualization of Colors and creation of new

2

I need to make use of the class Colors defined in the namespace Windows.UI .

There are many colors available and I'm having to find a way or a place to see a preview of those colors, because only by name is difficult to know the result.

Is it possible to create new colors based on RGB, or based on hexadecimal (HTML)?

    
asked by anonymous 31.12.2016 / 20:59

2 answers

3

See if the color sample shown in this documentation helps you .

There are some Color Picker softwares that do the name (I imagine these are universal names). An online that does this .

The ideal would be to make a code that generated all of them, including the content you want. You can do this easily by using reflection by reading all members of the class and using colors in whatever you want. In fact someone already did it with another color class and should be very easy to adapt to your need. There are examples too.

You can use any of the RGB pick, that is, about 16 million colors, usually used hexadecimal (ex. #C010FF ). The class is a facilitator with heavily used colors.

Note that where expects a color expects a https://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.color.aspx structure that is composed of 3 bytes, one for each base color (there is a fourth alpha layer, but this does not matter in that context). So what you put there is a number that you can by in hexadecimal or decimal. The colors of this class are just names for default values, you do not put a name there but a number, the name is just to help you. It goes without saying that variables are just names for a position in memory, which has values. There's nothing special about it.

What's so special is that XAML identifies itself whether it's using a name or value. This is done internally through type converters , but you do not even need to know this to use.

    
31.12.2016 / 21:45
2

An alternative (paid) Resharper (obviously using this tool only to view and create new colors is not feasible)

MeuBotao.Background = new SolidColorBrush(Color.FromArgb(255,0,0,255));

    
01.01.2017 / 00:05