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)); }
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)); }
static IntPtr Create(CGColor source, nfloat alpha) { if (source is null) { throw new ArgumentNullException(nameof(source)); } return(CGColorCreateCopyWithAlpha(source.GetCheckedHandle(), alpha)); }
public override bool Equals(object o) { CGColor other = o as CGColor; if (other == null) { return(false); } return(CGColorEqualToColor(this.handle, other.handle)); }
public void SetShadow(CGSize offset, nfloat blur, CGColor color = null) { if (color == null) { CGContextSetShadow(handle, offset, blur); } else { CGContextSetShadowWithColor(handle, offset, blur, color.handle); } }
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); }
public void SetStrokeColor(CGColor color) { CGContextSetStrokeColorWithColor(handle, color == null ? IntPtr.Zero : color.handle); }
public CGColor(CGColor source, nfloat alpha) : base(Create(source, alpha), true) { }