ColorRect becomes white if I set alpha to anything but 0

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Fenisto

So I have a ColorRect and I try to change its transparency thru code.
I write:
$ColorRect.color = Color(100,100,100,0) #becomes invisible
$ColorRect.color = Color(100,100,100,1) #becomes white
$ColorRect.color = Color(100,100,100,100) #becomes white
$ColorRect.color = Color(100.0,100.0,100.0,100.0) #becomes white
$ColorRect.color = Color(100,100,100,0.1) #becomes white
$ColorRect.color = Color(0.39,0.39,0.39,0.39) #becomes partially transparent
$ColorRect.color = Color(“64646464”) #becomes partially transparent

Is that a bug or is that supposed to work like that?

:bust_in_silhouette: Reply From: Gluon

Try

$ColorRect.color = Color(1, 0, 0, 1)

This should show as red

Then try playing with the zeros there. You are setting all the colours (red, blue, green) to the same value so they are blending together to make white.

Those numbers are for example. I use various numbers. All color variations turn white if I use any 3 numbers with alpha set to anything but 0.
I don’t think that colors can “blend”. rgb set to 255, 255, 255 “create” white.

Fenisto | 2021-11-27 17:32