示例#1
0
        public override void AddColorStop(object backend, double position, Xwt.Drawing.Color color)
        {
            GradientInfo gr = (GradientInfo)backend;

            gr.Colors.Add(color.ToCGColor());
            gr.Stops.Add((float)position);
        }
示例#2
0
        public override void SetColor(object backend, Xwt.Drawing.Color color)
        {
            CGContextBackend gc = (CGContextBackend)backend;

            gc.CurrentStatus.Pattern = null;
            // Store the current color for TextLayout using NSLayoutManager
            gc.CurrentStatus.GlobalColor = color.ToCGColor();
            CGContext ctx = gc.Context;

            ctx.SetFillColorSpace(Util.DeviceRGBColorSpace);
            ctx.SetStrokeColorSpace(Util.DeviceRGBColorSpace);
            ctx.SetFillColor((float)color.Red, (float)color.Green, (float)color.Blue, (float)color.Alpha);
            ctx.SetStrokeColor((float)color.Red, (float)color.Green, (float)color.Blue, (float)color.Alpha);
        }