core-graphics: add binding for CGColorCreateSRGB (#716)
Signed-off-by: Jay Madden <25359755+Jay-Madden@users.noreply.github.com>
This commit is contained in:
@@ -27,6 +27,13 @@ impl CGColor {
|
|||||||
CGColor::wrap_under_create_rule(ptr)
|
CGColor::wrap_under_create_rule(ptr)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn srgb(red: CGFloat, green: CGFloat, blue: CGFloat, alpha: CGFloat) -> Self {
|
||||||
|
unsafe {
|
||||||
|
let ptr = CGColorCreateSRGB(red, green, blue, alpha);
|
||||||
|
CGColor::wrap_under_create_rule(ptr)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg_attr(feature = "link", link(name = "CoreGraphics", kind = "framework"))]
|
#[cfg_attr(feature = "link", link(name = "CoreGraphics", kind = "framework"))]
|
||||||
@@ -37,5 +44,13 @@ extern "C" {
|
|||||||
blue: CGFloat,
|
blue: CGFloat,
|
||||||
alpha: CGFloat,
|
alpha: CGFloat,
|
||||||
) -> crate::sys::CGColorRef;
|
) -> crate::sys::CGColorRef;
|
||||||
|
|
||||||
|
fn CGColorCreateSRGB(
|
||||||
|
red: CGFloat,
|
||||||
|
green: CGFloat,
|
||||||
|
blue: CGFloat,
|
||||||
|
alpha: CGFloat,
|
||||||
|
) -> crate::sys::CGColorRef;
|
||||||
|
|
||||||
fn CGColorGetTypeID() -> CFTypeID;
|
fn CGColorGetTypeID() -> CFTypeID;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user