CSS rgba() for Xojo

I find it weird that the rgb() function provided by Xojo has the alpha channel backwards, so I wrote a function to allow you to use it like CSS rgba(). It’s not really worth putting on GitHub so I’m sharing it here for the archives.

Function rgba(r as Integer, g as Integer, b as Integer, a as Double) As Color return rgb(r, g, b, floor(255*(1.0 - a))) End Function

Put it wherever you keep your global methods, then when you need a color just use it like CSS:

dim myColor as Color = rgba(0, 0, 0, 0.6)