Beispiel #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));
        }
Beispiel #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));
        }
Beispiel #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));
        }
Beispiel #4
0
        public unsafe TransformEngineLayer pushTransform(
            float[] matrix4,
            TransformEngineLayer oldLayer = null
            )
        {
            D.assert(PaintingUtils._matrix4IsValid(matrix4));
            D.assert(_debugCheckCanBeUsedAsOldLayer(oldLayer, "pushTransform"));
            fixed(float *matrix4Ptr = matrix4)
            {
                TransformEngineLayer layer = new TransformEngineLayer(SceneBuilder_pushTransform(_ptr, matrix4Ptr));

                D.assert(_debugPushLayer(layer));
                return(layer);
            }
        }
Beispiel #5
0
 public void drawParagraph(Paragraph paragraph, Offset offset)
 {
     D.assert(paragraph != null);
     D.assert(PaintingUtils._offsetIsValid(offset));
     paragraph.paint(this, offset);
 }