1 // mcs mkcolor.cs -pkg:dotnet
4 using System
.Reflection
;
10 PropertyInfo
[] properties
= typeof (Color
).GetProperties (BindingFlags
.Public
| BindingFlags
.Static
);
11 // { "black", 0xFF000000 },
12 foreach (PropertyInfo pi
in properties
) {
13 Color color
= Color
.FromName (pi
.Name
);
14 Console
.WriteLine ("\t{{ \"{0}\",\t\t0x{1:X2}{2:X2}{3:X2}{4:X2} }},", pi
.Name
.ToLower (), color
.A
, color
.R
, color
.G
, color
.B
);