Well, actually no.
Not right approach.
You are doing the opposite of what I wrote.
class holds ONLY ONE triangle
For loop in setup sets different x for each triangle in the array (that you defined before draw())
In the class no for loops at all
For loop in draw
I mean your way cannot make different shades of black