Polygon (rectangle) Code Component

How have you specified the colour for JS? I had issues with colours and this post really helped me: