示例#1
0
        public CGColor(CGColorSpace colorspace, nfloat [] components)
        {
            if (components == null)
            {
                global::ObjCRuntime.ThrowHelper.ThrowArgumentNullException(nameof(components));
            }
            var colorspace_handle = colorspace.GetNonNullHandle(nameof(colorspace));

            handle = CGColorCreate(colorspace_handle, components);
        }
示例#2
0
        static IntPtr Create(CGColorSpace colorspace, nfloat [] components)
        {
            if (components is null)
            {
                global::ObjCRuntime.ThrowHelper.ThrowArgumentNullException(nameof(components));
            }
            var colorspace_handle = colorspace.GetNonNullHandle(nameof(colorspace));

            return(CGColorCreate(colorspace_handle, components));
        }
示例#3
0
        public CGColor(CGColorSpace colorspace, CGPattern pattern, nfloat [] components)
        {
            if (components == null)
            {
                global::ObjCRuntime.ThrowHelper.ThrowArgumentNullException(nameof(components));
            }
            var colorspace_handle = colorspace.GetNonNullHandle(nameof(colorspace));
            var pattern_handle    = pattern.GetNonNullHandle(nameof(pattern));

            handle = CGColorCreateWithPattern(colorspace_handle, pattern_handle, components);
            if (handle == IntPtr.Zero)
            {
                throw new ArgumentException();
            }
        }