ikskuh / SDL.zig

A shallow wrapper around SDL that provides object API and error handling
MIT License
348 stars 75 forks source link

Add default colour alpha argument #176

Closed DispairingGoose closed 3 months ago

DispairingGoose commented 3 months ago

When handling Colour, there are times when you do want to consider alpha, but times when you don't and in those cases you want an alpha of 255.

Whilst you can use the rgb function for this, due to the lack of type inference, you have to specify sdl.Color.rgb(x, y, z), whereas with this pr, you can do .{ .r = x, .g = y, .b = z } which is much cleaner, as well as not forcing you to @import sdl.

I would even go as far to argue the removal of the rgb function, however I have not included that in this pr because backwards compatibility as well as this pr taking much longer to get merged, if at all.

DispairingGoose commented 3 months ago

Thank you :)