-
Notifications
You must be signed in to change notification settings - Fork 6
Make more methods public #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Fellow contributors - @robotive @stphnclysmth @jaywardell @nickswalker - could you offer advice? I looked at this repo again after receiving a PR with more initializers: #17 (cc @jaywardell) Why are we monkey-patching platform APIs ( Instead of monkey-patched initializers we can just offer instructions in the README like this: import HSLuvSwift
let rgb = hsluvToRgb(hue, saturation, lightness)
let color = UIColor(red: rgb.R, green: rgb.G, blue: rgb.B, alpha: 1.0) Thoughts? |
From my perspective, making the conversion functions public would work just as well as my additions. Of course, it’s easy enough to do both: make the functions public AND offer conditionally compiled extensions on platform-specific types. |
If you wanted to expose the conversion functions, I could make a separate package that imports hsluv-swift and offers the platform-dependent initializers. It would mean removing functionality from the original framework, but it would be easy enough to point folks to the second package. We could separate functionality between: When I was doing the SwiftUI initializers, it occurred to me that there could be a more idiomatic SwiftUI way to do things (eg using the Angle type) if I weren’t trying to maintain consistency with the other initializers. If the packages were split, that would be simpler to do. lmk |
Hi there,
Would it be possible to make more components public, or add public extension methods, mainly to obtain the HSLuv components of a
UIColor/NSColor
object ?Thanks for considering
The text was updated successfully, but these errors were encountered: