How do I set a color with a progressive alpha in a Polygon2D

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By dabrain34
:warning: Old Version Published before Godot 3 was released.

Hello,

I drew a custom polygon2D and set a color but i’m not able to change the alpha in the color class by code to a scalable value.
Indeed it’s either 0 or 1 when i’m using setColor(Color(0,255,0,128)).
Using the editor seems to work better but i need to draw perfect rectangle with custom alpha and color.
Maybe i can use another way to define my polygon color ?

:bust_in_silhouette: Reply From: eons

Color values are normalized, with Color(0,255,0,128) you are saying Color(0.0,1.0,0.0,1.0), for 50% alpha use 0.5.
https://godot.readthedocs.io/en/stable/classes/class_color.html

:bust_in_silhouette: Reply From: dabrain34

Here is a usefull converter from RGB Hex to RGB normalized decimal.