Skip to content

Instantly share code, notes, and snippets.

@dharmatech
Created June 4, 2010 17:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dharmatech/425682 to your computer and use it in GitHub Desktop.
Save dharmatech/425682 to your computer and use it in GitHub Desktop.

chiaroscuro

chiaroscuro image

Scheme version

(import (psilab cfdg core)
        (psilab cfdg rule))

(rule black
      (60 (circle (scale 0.6))
          (black (x 0.1)
                 (rotate 5)
                 (scale 0.99)
                 (brightness -0.01)
                 (alpha -0.01)))

      (1 (white) (black)))

(rule white
      (60 (circle (scale 0.6))
          (white (x 0.1)
                 (rotate -5)
                 (scale 0.99)
                 (brightness 0.01)
                 (alpha -0.01)))

      (1 (black) (white)))

(rule chiaroscuro
      (1 (black (brightness 0.5))))

(init-cfdg)

(background (brightness -0.5))

(bounds -3 3 -2 4)

(start-shape chiaroscuro)

CFDG version

background {b -.5}
 
startshape CHIAROSCURO
 
rule CHIAROSCURO {
    BLACK {b .5}
}
 
rule BLACK 60 {
    CIRCLE {s .6}
    BLACK {x .1 r 5 s .99 b -.01 a -.01}
}
rule BLACK {
    WHITE {}
    BLACK {}
}
 
rule WHITE 60 {
    CIRCLE {s .6}
    WHITE {x .1 r -5 s .99 b .01 a -.01}
}
rule WHITE {
    BLACK {}
    WHITE {}
}

Original at the gallery

Rendered in Ypsilon Scheme using the psilab libraries

Ported to Scheme by Ed Cavazos

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment