Default alpha to 1 for Color4.FromHexString

Heya, I was wondering if Color4.FromHexString could default alpha to 1 instead of 0?

The issue is that most of the hex codes from color tables on the web, etc. don’t have an extra two characters for the alpha…

So it can be tedious to copy and paste the hex code and then have to remember to add the extra ff at the end and again each time after copying and pasting a new hex string over the existing one to try out different colors, for example…

Let me know if it would be good to do and I’ll make a little PR for it. :slight_smile:

image

It is, however, a breaking change. And needs to be documented in the breaking changes section of what’s new.

Having said that - what’s wrong with using the Color3.FromHexString in that case? Would make more sense in terms of color conversion

1 Like

For instance when setting the face colors using MeshBuilder.Create functions, a Color4 is needed, same with the scene’s clear color, so converting with Color4.FromHexString() without having to add ff to the end of it would be more convenient here I think, especially when copying and pasting the hex strings from color tables and other tools on the web.

Here’s a little PR for it, with a note in the breaking changes section. :slightly_smiling_face:

2 Likes