Esempio n. 1
0
        public static Sm.Brush ToMediaBrush(this Wg.Fill input)
        {
            Sm.Brush brush = null;
            switch (input.FillType)
            {
            default:
                brush = new Sm.SolidColorBrush(input.Background.ToMediaColor());
                break;

            case Wg.Fill.FillTypes.LinearGradient:
                brush = ((Wg.GradientLinear)input).ToMediaBrush();
                break;

            case Wg.Fill.FillTypes.RadialGradient:
                brush = ((Wg.GradientRadial)input).ToMediaBrush();
                break;

            case Wg.Fill.FillTypes.Pattern:
                brush = new Sm.SolidColorBrush(input.Background.ToMediaColor());
                break;

            case Wg.Fill.FillTypes.Bitmap:
                brush = new Sm.SolidColorBrush(input.Background.ToMediaColor());
                break;
            }

            return(brush);
        }
Esempio n. 2
0
        public static string ToSVG(this Wg.Fill input)
        {
            string output = "<style>" + Environment.NewLine;

            output += ".cls-" + input.ID + "{" + Environment.NewLine;
            output += "fill:" + input.Background.ToSVG() + ";" + Environment.NewLine;
            output += "fill-opacity:" + input.Background.A / 255.0 + ";" + Environment.NewLine;
            output += "}";
            output += "</style>";
            return(output);
        }