Example #1
0
        static public CGColor?CreateByMatchingToColorSpace(CGColorSpace space, CGColorRenderingIntent intent,
                                                           CGColor color, NSDictionary options)
        {
            var h = CGColorCreateCopyByMatchingToColorSpace(space.GetHandle(), intent, color.GetHandle(), options.GetHandle());

            return(h == IntPtr.Zero ? null : new CGColor(h, owns: true));
        }
Example #2
0
        static CGColor CreateByMatchingToColorSpace(CGColorSpace space, CGColorRenderingIntent intent,
                                                    CGColor color, NSDictionary options)
        {
            var h = CGColorCreateCopyByMatchingToColorSpace(space == null ? IntPtr.Zero : space.Handle, intent,
                                                            color == null ? IntPtr.Zero : color.Handle, options == null ? IntPtr.Zero : options.Handle);

            return(h == IntPtr.Zero ? null : new CGColor(h));
        }
Example #3
0
 static IntPtr Create(CGColor source, nfloat alpha)
 {
     if (source is null)
     {
         throw new ArgumentNullException(nameof(source));
     }
     return(CGColorCreateCopyWithAlpha(source.GetCheckedHandle(), alpha));
 }
Example #4
0
        public override bool Equals(object o)
        {
            CGColor other = o as CGColor;

            if (other == null)
            {
                return(false);
            }

            return(CGColorEqualToColor(this.handle, other.handle));
        }
Example #5
0
 public void SetShadow(CGSize offset, nfloat blur, CGColor color = null)
 {
     if (color == null)
     {
         CGContextSetShadow(handle, offset, blur);
     }
     else
     {
         CGContextSetShadowWithColor(handle, offset, blur, color.handle);
     }
 }
Example #6
0
        public CGColor(CGColor source, nfloat alpha)
        {
            if (source == null)
            {
                throw new ArgumentNullException("source");
            }
            if (source.handle == IntPtr.Zero)
            {
                throw new ObjectDisposedException("source");
            }

            handle = CGColorCreateCopyWithAlpha(source.handle, alpha);
        }
Example #7
0
 public void SetStrokeColor(CGColor color)
 {
     CGContextSetStrokeColorWithColor(handle, color == null ? IntPtr.Zero : color.handle);
 }
Example #8
0
 public CGColor(CGColor source, nfloat alpha)
     : base(Create(source, alpha), true)
 {
 }