Exemplo n.º 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;
Exemplo n.º 2
0
 internal CompositionGradientBrush(Compositor compositor)
     : base(compositor)
 {
     ColorStops = new CompositionColorGradientStopCollection(this);
 }