As a Roblox developer, it is currently too hard to apply RGBA values to GuiObjects.
I’m working on something that can load in RGBA values from a JSON file, however, to assign the alpha channel, I have to do extra work to just assign the transparency, instead of mapping it cleanly to one property.
Currently, in theory, this is what I have to do to split the RGB from the RGBA and have it map properly
This requires a lot of extra work to extract the alpha channel when it would be cleaner to have a single property that accepts an RGBA datatype:
text.TextColor4 = c4 -- c4 = Color4
If Roblox is able to address this issue, it would improve my development experience because I would then be able to use RGBA values without needing to do loads of extra work to assign the transparency channel.
Another use case for an RGBA type would be EditableImages.
The API for EditableImages seems to be rushed and lacks any sort of type safety, as pixels are simply referred to the documentation as 4 numbers representing RGBA respectively.
Implementing an RGBA type would allow EditableImages to specify it as a type, making things more safe (and less confusing).
Highly support this. It would make EditableImage be a little bit more user friendly too. Even though I personally much prefer working with pure RGBA numbers, having this option would be great too!
I don’t see a reason why bringing Roblox to industry-standard APIs is bloat and can justify why this isn’t a good idea. Adding more classes isn’t going to slow down the engine, and along as Color3 remains unaltered, backwards compatibility is also guaranteed.
In fact, by not adding Color4 (and maybe Quaternions), one could argue that this would require us to add unnecessary bloat to our own games.
Not only that but it would also solve a lot of personal inefficiencies I’m having with the API, current bottleneck I’m running into with DynamicImages is the act of reading/writing to/from 4 different table values and constructing a Color3 + alpha with them. If DynamicImage supported a Color4 datatype, I would end up needing to do somewhat less work regarding the keys in the table and, as a result, be able to render effects at higher resolutions.
So deprecate it then…that is normal in programming to deprecate the old with the new and better lol. And color 3 does not have a transparency property… Having an RGBA data type is normal even at the graphics programming level. His use case perfectly describes the need of an RGBA instance, simple and straight to the point. Does he need a thesis for roblox to add rgba or something? lol.
While this is certainly a feature that would benefit the engine by bringing it up to industry standard, it would be more of a quality-of-life improvement for the developers than anything else. Currently, it is not at all all hard to change a Color and Transparency property at the same time. I would even describe it as simple and easy. This is evidenced by your example:
You mention that it requires “a lot of extra work” in order to accomplish this when it only takes a single extra line compared to your proposed solution. Additionally, the extra line isn’t even complicated in the slightest, merely being a simple property assignment. Therefore, although I do support this as a quality-of-life improvement, I don’t believe it’d be significant enough of a change to warrant the developer team to implement anytime soon.
I do admit that this would make utilizing EditableImage’s easier, but, as I stated above, not significant enough to implement anytime soon, even though I’d support it. Especially when, at the time of this posting, Color3 values still don’t support basic math operations.