Ejemplo n.º 1
0
        public static XdColorValueJson GetFillColor(this XdStyleJson xdStyleJson)
        {
            var color = new XdColorValueJson {
                R = 255, G = 255, B = 255
            };
            var fill = xdStyleJson.Fill;

            if (fill?.Color?.Value?.R != null)
            {
                color.R = fill.Color.Value.R;
                color.G = fill.Color.Value.G;
                color.B = fill.Color.Value.B;
            }
            return(color);
        }
Ejemplo n.º 2
0
 public static string ToColorString(this XdColorValueJson colorValue)
 {
     return($"#{colorValue.R:x2}{colorValue.G:x2}{colorValue.B:x2}");
 }