I’d use angles to make the mesh as it makes the vertices go round the circle evenly which is easier to work with for colours and textures. You can also reuse meshes so depending on what you intend to do, it might be enough to create one mesh and draw it many times.
-- CircleMesh
function setup()
local v = {}
local c = {}
local n = 30
local x,y = 1,0
for k=1,n do
table.insert(v,vec2(0,0))
table.insert(v,vec2(x,y))
table.insert(c,color(255,0))
table.insert(c,hsl((k-1)/n,1,.5))
x,y = math.cos(2*math.pi/n*k),math.sin(2*math.pi/n*k)
table.insert(v,vec2(x,y))
table.insert(c,hsl(k/n,1,.5))
end
m = mesh()
m.vertices = v
m.colors = c
p = {}
for k=1,100 do
table.insert(p,{
math.random(0,WIDTH),
math.random(0,HEIGHT),
math.random(20,60),
math.random(20,60),
math.random(1,360)
})
end
end
function draw()
background(40,40,50)
for k,v in ipairs(p) do
pushMatrix()
translate(v[1],v[2])
rotate(v[5]+ElapsedTime*60)
scale(v[3],v[4])
rotate(-ElapsedTime*30)
m:draw()
popMatrix()
end
end
function hsl(h,s,l,a)
h = (h-math.floor(h))*6
s = s or 1
l = l or 1
a = a or 255
local c = (1-math.abs(2*l-1))*s*255
local m = l*255 - c/2
local x = c*(1 - math.abs(h%2 - 1))
local r,g,b
if h < 1 then
r,g,b = c+m,x+m,m
elseif h < 2 then
r,g,b = x+m,c+m,m
elseif h < 3 then
r,g,b = m,c+m,x+m
elseif h < 4 then
r,g,b = m,x+m,c+m
elseif h < 5 then
r,g,b = x+m,m,c+m
else
r,g,b = c+m,m,x+m
end
return color(r,g,b,a)
end