Exemple #1
0
        private void UpdateColorStops(CompositionColorGradientStopCollection colorStops)
        {
            var stopCount      = colorStops.Count;
            var colors         = _colors;
            var colorPositions = _colorPositions;

            if (colors == null || colors.Length != stopCount)
            {
                colors         = new SKColor[stopCount];
                colorPositions = new float[stopCount];
            }

            for (int i = 0; i < colorStops.Count; i++)
            {
                var gradientStop = colorStops[i];

                colors[i]           = gradientStop.Color.ToSKColor();
                colorPositions ![i] = gradientStop.Offset;
 internal CompositionGradientBrush(Compositor compositor)
     : base(compositor)
 {
     ColorStops = new CompositionColorGradientStopCollection(this);
 }