/*
 * $VER: Stars 3.01 (7.5.98)
 *
 * Arexx program for the ImageFX image processing system.
 * Written by Thomas Krehbiel
 *
 * Draws a lot of random stars into the current buffer.
 *
 * Modified 9805.07 by J.A. Whiting to restore palette
 * register's original contents.
 *
 */

OPTIONS RESULTS

GetMain ; IF result = "" THEN EXIT ; PARSE VAR result name width height depth .

SaveUndo ; Undo Off ; Redraw Off
GetPalette '-1'
PARSE VAR result red green blue
BeginBar 'Stars' 1000

DO i = 1 TO 1000

   Bar i
   LockGui
   x = randu() * width
   y = randu() * height
   g = random(64,255)
   SetPalette '-1' g g g
   Point x y
   UnlockGui Quiet

   END

EndBar

Undo On ; Redraw On ; Redraw
SetPalette '-1' red green blue

EXIT

