mackenir
mackenir

Reputation: 10969

Can I get the RGB of a system color in C# without using pinvoke?

I want to determine the RGB color of a system color such as SystemColors.HotTrack.

Is there a way to do this without resorting to using P/Invoke and GetSysColor (not including drawing into a bitmap and checking pixel values)?

Upvotes: 3

Views: 2162

Answers (1)

bitbonk
bitbonk

Reputation: 49609

byte r = SystemColors.HotTrack.R;
byte g = SystemColors.HotTrack.G;
byte b = SystemColors.HotTrack.B;

or

int argb = SystemColors.HotTrack.ToArgb();

Upvotes: 12

Related Questions