(defn background
"
Examples:
(use 'incanter.processing)
(def sktch (sketch))
(background sktch (color 255 0 255))
(draw sktch)
(background sktch (color 255 0 255 255)) ;; with alpha value
(draw sktch)
(background sktch (color \"0xFF00FF\"))
(draw sktch)
(background sktch (color 0xFF00FF))
(draw sktch)
(background sktch (color -65281))
(draw sktch)
(background sktch (color 0xFFFF00FF true)) ;; with alpha? true
(draw sktch)
(background sktch (color 0xFF 0x00 0xFF))
(draw sktch)
(background sktch (color 0xFF 0x00 0xFF 0xFF)) ;; with alpha value
(draw sktch)
(background sktch (color 1.0 0.0 1.0))
(draw sktch)
(background sktch (color 1.0 0.0 1.0 1.0)) ;; with alpha value
(draw sktch)
"
([^PApplet sketch gray]
(cond
(string? gray)
(.background sketch (color gray))
(integer? gray)
(.background sketch (int gray))
(float? gray)
(.background sketch (float gray))
(= java.awt.Color (type gray))
(.background sketch ^java.awt.Color gray)))
([^PApplet sketch gray alpha]
(cond
(string? gray)
(.background sketch (color gray) (int alpha))
(integer? gray)
(.background sketch (int gray) (int alpha))
(float? gray)
(.background sketch (float gray) (float alpha))))
([^PApplet sketch r g b]
(cond
(or (integer? r) (integer? g) (integer? b))
(.background sketch (int r) (int g) (int b))
(or (float? r) (float? g) (float? b))
(.background sketch (float r) (float g) (float b))))
([^PApplet sketch r g b a]
(cond
(or (integer? r) (integer? g) (integer? b))
(.background sketch (int r) (int g) (int b) (int a))
(or (float? r) (float? g) (float? b))
(.background sketch (float r) (float g) (float b) (float a)))))
Used in 0 other vars
Comments top
No comments for background. Log in to add a comment.