Easter Eggs

Post Reply
User avatar
rbytes
Posts: 1971
Joined: Sun May 31, 2015 12:11 am
My devices: iPhone X
iPad 4
MacBook
Dell Inspiron laptop
CHUWI Plus 10 convertible Windows/Android tablet
Location: Calgary, Canada
Flag: Canada
Contact:

Easter Eggs

Post by rbytes » Mon Apr 01, 2019 8:39 pm

Just in time to get ready. No need to paint a bunch of eggs. This program will do that for you. Sorry, solid colors only.

Code: Select all

/*
Easter Eggs by rbytes
revised March 2019
*/
SET TOOLBAR OFF
laun$=LAUNCHER$ ()
GET SCREEN SIZE sw, sh
GRAPHICS
GRAPHICS CLEAR
FILL ALPHA 1
FOR t = 1 TO 160
freq=RND(1)
SIZE=RND(30)+10+t*2
x=RND(sw)
y=RND(sh)
FOR u=SIZE TO 1 STEP-1
pal(freq,.4,1,1-u/(3*SIZE))
FILL COLOR pal.r,pal.g,pal.b
FILL CIRCLE X,Y SIZE .25*SIZE*(u/SIZE),.25*SIZE*(u/SIZE)*.7
NEXT u
GET TOUCH 0 AS tx,ty!IF ty>-1 THEN ender
PAUSE .1
NEXT t
'GRAPHICS SAVE 0,0,sw,sh TO "easter.png"
'ALBUM EXPORT "easter.png"
wait:SLOWDOWN!GET TOUCH 0 AS tx,ty!IF tx=-1 THEN wait
ender:
IF laun$="desktop" THEN
  IF FILE_EXISTS("/launch") THEN
    RUN "/-Launch.sb"
  ELSE
    EXIT
  ENDIF
  END
ENDIF


' condensed version of Dutchman's Palet function
'g'!DEF pal(tnt,sat,brt,iny)!tnt%=1
sat=ABS(sat)!IF sat>1 THEN sat%=1
iny=ABS(iny)!IF iny>1 THEN iny%=1
brt=ABS(brt)!IF brt>1 THEN brt%=1
tnt*=6!sect=INT(0.5+tnt)!tnt%=1
ON sect GOTO s1,s2,s3,s4,s5,s6
s1:b=1!r=0!g=tnt!GOTO satr
s2:g=1!r=0!b=1-tnt!GOTO satr
s3:g=1!b=0!r=tnt!GOTO satr
s4:r=1!b=0!g=1-tnt!GOTO satr
s5:r=1!g=0!b=tnt!GOTO satr
s6:b=1!g=0!r=1-tnt!satr:IF sat<1 THEN
y=0.3*r+0.59*g+0.11*b!u=b-Y!u*=sat
v=r-Y!v*=sat!w=g-Y!w*=sat!r=y+v!g=y+w!b=y+u
IF brt<>0 THEN!ysup=1-MAX(MAX(r,g),b)
ysup*=brt!r+=ysup!g+=ysup!b+=ysup!ENDIF!ENDIF
IF iny<1 THEN!r*=iny!g*=iny!b*=iny!ENDIF
y=0.3*r+0.59*g+0.11*b!ENDDEF
Attachments
5044ED51-A426-4570-8871-7A9780C38986.png
5044ED51-A426-4570-8871-7A9780C38986.png (2.22 MiB) Viewed 91 times
####### Living the colorful life #######

Post Reply