Closed imprity closed 5 months ago
Sorry, I'm dumb and I didn't realize I could just declare something like
type RaylibColor = color.RGBA
to make it clear this type is intended for raylib.
But then again, if you don't mind, I think doing something like that in raylib-go itself would be a nice way to solve the problem I mentioned above without breaking a backward compatibility : )
Wait, I didn't realize it had it's own color type until 29ba3cc50849d5fd09af003e40bb6870974dab8e ..... Sorry, my bad.
Whether raylib's colors are alpha premultiplied or not is determined by functions like SetBlendMode.
But go's image/color package's color types embed information on whether if it's alpha premultiplied or not.
So I think using image/color's color.RGBA type is misleading since it implies that colors are alpha premultiplied.
I think more honest thing would be to declare and use custom color type with 4 uint8 instead of using go's image/color package's RGBA type.
But maybe it's too late to fix it now....
I wrote some code to demonstrate this problem