问题
I have a one question. I use OxyPlot in WPF, C#. I need to have all colors to MarkerType and MarkerStroke for series. How I can get all colors?
回答1:
Green, IndianRed, etc are static fields in static OxyColors class. use reflection to read all of them
var colors = typeof(OxyColors)
.GetFields(BindingFlags.Static | BindingFlags.Public)
.Where(f => f.FieldType == typeof(OxyColor))
.Select(f => f.GetValue(null))
.Cast<OxyColor>()
.ToList();
来源:https://stackoverflow.com/questions/50602161/how-i-can-get-all-colors-in-oxyplot