Plasma effect: Difference between revisions

m
→‎{{header|Sidef}}: added link to output file
m (→‎{{header|Sidef}}: added link to output file)
Line 1,314:
 
method init {
img = %sO|Imager|.new(xsize => width, ysize => height)
}
 
method generate {
for y,x in =(^height), ~X x=(^width) {
var hue = (4 + sin(x/19) + sin(y/9) + sin((x+y)/25) + sin(hypot(x, y)/8))
img.setpixel(x => x, y => y, color => Hash(hsv => [360 * hue / 8, 1, 1]))
Line 1,332:
plasma.generate
plasma.save_as('plasma.png')</lang>
Output image: [https://github.com/trizen/rc/blob/master/img/plasma-effect-sidef.png Plasma effect]
2,747

edits