Skip to content
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

Use Color32 from ecolor #34

Open
thatcomputerguy0101 opened this issue Jul 6, 2024 · 1 comment
Open

Use Color32 from ecolor #34

thatcomputerguy0101 opened this issue Jul 6, 2024 · 1 comment

Comments

@thatcomputerguy0101
Copy link
Contributor

thatcomputerguy0101 commented Jul 6, 2024

Instead of implementing a custom Srgba type, compatibility with the egui color picker (and possibly others) would be increased if the Color32 type from the ecolor crate is used instead. This would be a breaking change for all places where the current Srgba type is created/accessed, so an alternative solution would be to add conversion traits to/from Color32. A workaround for my own needs is to use the array form as an intermediary, since both sides support converting to/from arrays. I think it would be better to entirely remove the existing color type since that also gives easy access to all of Color32's constructors, but also understand if making that switch is undesired. I'd be willing to help implement either of the two solutions.

@asny
Copy link
Owner

asny commented Nov 15, 2024

Hmm. Yeah, it's the usual conversion problem (exactly the same issue with the math library, people use different libraries and have to convert from one type to another). Probably I shouldn't have introduced yet another color type, but I think I wouldn't choose ecolor, it's a bit too tied to egui. Maybe palette crate or something? Implementing color conversions means that I have to do a feature with the ecolor dependency only for that. Seems like a bit too much. Using raw array of colors is also an option, but I think it's nice with some kind of color implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants