Esempio n. 1
0
        public static Gradient radial(
            Offset center, float radius, List <Color> colors,
            List <float> colorStops = null, TileMode tileMode = TileMode.clamp,
            uiMatrix3?matrix        = null)
        {
            D.assert(PaintingUtils._offsetIsValid(center));
            D.assert(colors != null && colors.Count >= 2);

            _validateColorStops(ref colors, ref colorStops);

            return(new _RadialGradient(center, radius, colors, colorStops, tileMode, matrix));
        }
Esempio n. 2
0
        public static Gradient linear(
            Offset start, Offset end, List <Color> colors,
            List <float> colorStops = null, TileMode tileMode = TileMode.clamp,
            uiMatrix3?matrix        = null)
        {
            D.assert(PaintingUtils._offsetIsValid(start));
            D.assert(PaintingUtils._offsetIsValid(end));
            D.assert(colors != null && colors.Count >= 2);

            _validateColorStops(ref colors, ref colorStops);

            return(new _LinearGradient(start, end, colors, colorStops, tileMode, matrix));
        }
Esempio n. 3
0
        public static Gradient sweep(
            Offset center, List <Color> colors,
            List <float> colorStops = null, TileMode tileMode = TileMode.clamp,
            float startAngle        = 0.0f, float endAngle    = Mathf.PI * 2,
            uiMatrix3?matrix        = null)
        {
            D.assert(PaintingUtils._offsetIsValid(center));
            D.assert(colors != null && colors.Count >= 2);
            D.assert(startAngle < endAngle);

            _validateColorStops(ref colors, ref colorStops);

            return(new _SweepGradient(center, colors, colorStops, tileMode, startAngle, endAngle, matrix));
        }
Esempio n. 4
0
 public void drawParagraph(Paragraph paragraph, Offset offset)
 {
     D.assert(paragraph != null);
     D.assert(PaintingUtils._offsetIsValid(offset));
     paragraph.paint(this, offset);
 }