create 1d or 2d texture "at hand"(from the code)

hello.
I have a huge number of object that change only for the color and the dimension.
I wish store all the colors and scale factor in a texture for don’t call 3242134142 webgl .
The model is a static model .

how i can create a texture with javascript and webgl?
Is possible?
thanks.