1.2.3-SNAPSHOT Arrow_down_16x16

background

incanter.processing

  • (background sketch gray)
  • (background sketch gray alpha)
  • (background sketch r g b)
  • (background sketch r g b a)

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)



0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source incanter/processing.clj:111 top

(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)))))
Vars in incanter.processing/background: = cond defn float float? int integer? or string? type
Used in 0 other vars

Comments top

No comments for background. Log in to add a comment.