Static properity injection to native Classes

I am trying add variety to Color class for example:
Color c = Color.clearWhite;//Should return RGBA (1, 1, 1, 0).
or
Color y = Color.trueYellow;//Should return RGBA(1,1,0,1).
etc.

is there a way to implement this?
thanks in advance.

Not exactly, but you can write extension method for it. It would be almost like that except for parentheses at the end.

1 Like