About Color.Alpha

aColor.Alpha is documented as a read only property of a color … Is there a specific reason there is not also a setter? While I have never needed to set the RGB values of a color individually, lately I find myself needed to do that. The straightforward way the framework gives to do that is to do:

aColor = Color.RGBA(aColor.Red, aColor.Geen, aColor.Blue, AlphaValue)
Which is rather messy and long…
(yes It could be done other ways I know)

So is there a specific reason why there is not a setter for it so I could just do:
aColor.Alpha = AlphaValue

Or is that something I should put feature request in for.

-Karen

cough … extends … cough
there are other ways to manipulate this that do not involve creating a new color

but yeah put in a FR as well

[quote=492783:@Norman Palardy]cough … extends … cough
[/quote]

Try it… Doesn’t not work… It will compile if you don’t use it, but when you actually try to use it the compilation fails… at least on 2019R1

Can’t reproduce, works well here with this:

[code]Public Sub Alpha(extends byref cVal as Color, assigns tiVal as Integer)
cVal = Color.RGBA(cVal.Red, cVal.Green, cVal.Blue, tiVal)

End Sub
[/code]
Edit: Got my blue and green mixed up. Tested with a red square >_>

[quote=492788:@Tim Parnell]Public Sub Alpha(extends byref cVal as Color, assigns tiVal as Integer)
cVal = Color.RGBA(cVal.Red, cVal.Green, cVal.Blue, tiVal)

End Sub[/quote]

Must have had another issue… Will try again… I deleted my original code so I can’t look at it… Maybe forgot the ByRef? Will try again.

-karen