3

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)?

mackenir
  • 10,801
  • 16
  • 68
  • 100

1 Answers1

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

or

int argb = SystemColors.HotTrack.ToArgb();
bitbonk
  • 48,890
  • 37
  • 186
  • 278
  • Aw heck. I tried that, but for some reason thought it didnt work - a problem with some other code I think. :) – mackenir Feb 23 '10 at 11:47