Skip to content

Specify color space when generating gradient #6

@Thomasch

Description

@Thomasch

When I changed to use P3 wide colors in our app, I noticed that the gradients didn't use that color space.

I looked through the code and saw that MKGradientGenerator uses CGColorSpaceCreateDeviceRGB. I changed that to CGColorSpace(name: CGColorSpace.displayP3) and the gradient was displaying in P3.

Maybe you can add a parameter (with default value) or get the color space from the start/end color?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions