Using , I want to set the RGBa value of the rectangle using a variable.
for example:
ctx.fillStyle = \"rgba(32, 45, 21, 0
You just need to concatenate the r_a variable to build the string correctly:
r_a
var r_a = 0.3; ctx.fillStyle = "rgba(32, 45, 21, " + r_a + ")";