Closed 0xEAB closed 6 months ago
This seems ok enough, I just normally do the division but it is a bit lossy to store it that way (the minigui color widget has some hacks to deal with the lossy conversions so it doesn't break the ui, it is p hacky lol).
I've always avoided using that in(expr)
thing because it wasn't compatible with older compilers, but I think I've dropped support for them now... my old raspberry pi even i think uses a newer gdc now. But if that fails I'll just edit.
Another potential future direction would be to template some of this for other types but I'm not sure it is worth the complication, so let's just do this, if needed we can do compatibility aliases later.
Note that there’s an embarrassing bug in here. Gonna send another PR :/
Adds floating-point color representation wrapper struct (with contracts) to
arsd.color
.Use case
Correct me, if there’s something better for this already in there.