Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get a Brush from a RGB Code?

How can I get a Brush to set a Background of e.g. a Grid from a RGB Code.

I hace the RGB Code as a int:

R = 12
B = 0
G = 255

I need to know how to convert it into a Brush

like image 965
gurehbgui Avatar asked Apr 26 '13 15:04

gurehbgui


1 Answers

var brush = new SolidColorBrush(Color.FromArgb(255, (byte)R, (byte)G, (byte)B));
myGrid.Background = brush;
like image 61
Chris Sinclair Avatar answered Oct 13 '22 21:10

Chris Sinclair