The plasma effect is a visual effect created by applying various functions, notably sine and cosine, to the color values of screen pixels. When animated (not a task requirement) the effect may give the impression of a colorful flowing liquid.



Task
Create a plasma effect.




See also
 Computer Graphics Tutorial (lodev.org)
 Plasma (bidouille.org)


using Luxor, Colors
 
Drawing(800, 800)
 
function plasma(wid, hei)
    for x in 1:wid, y in 1:hei
        sethue(parse(Colorant, HSV(180 + 45sin(x/19) + 45sin(y/9) +
            45sin((x+y)/25) + 45sin(sqrt(x^2 + y^2)/8), 1, 1)))
        circle(Point(x, y), 1, :fill)
    end
end
 
@png plasma(800, 800)
 