-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
add color functions #9
Comments
That would be awesome! I think a really generic Color type would be nice, with multiple constructors, and ways to generate colors at the end like you wrote. pub opaque type Color {
Color(
red: Int,
green: Int,
blue : Int,
alpha: Int,
luminance: Int
)
}
pub fn hex(hex: String) -> Result(Color, Error) {
parse_hex(hex)
}
pub fn rgba(r, g, b, a) -> Result(Color, Error) {
parse_rgba(r, g, b, a)
} |
I wonder whether is should resides in sketch or not in the end. Maybe managing colors would just be something generic, and can be build easily on its own, before turning them into strings. I see two directions:
I really much prefer option 2. The real strong upside is see to the first option though is to avoid people to install 2 different packages in |
started here! give me your thoughts, open issues if you think it's worth and let's do it! https://github.com/brunoti/lumiere pure gleam! |
That seems really great ! 💜 It seems to be a great foundation to start with, the goal is probably now to test it properly, and add the desired features ( |
After more work on the project, I'd prefer a proper implementation of colors would be to use gleam-community/colour. I'll keep this open if anyone is interested. |
I'm thinking of:
But let's discuss the API
The text was updated successfully, but these errors were encountered: