1.2.3-SNAPSHOT Arrow_down_16x16
  • (fill sketch gray)
  • (fill sketch gray alpha)
  • (fill sketch x y z)
  • (fill sketch x y z alpha)

Sets the color used to fill shapes. For example, if you run (fill 204 102 0), all
subsequent shapes will be filled with orange. This color is either specified in
terms of the RGB or HSB color depending on the current colorMode() (the default
color space is RGB, with each value in the range from 0 to 255).

When using hexadecimal notation to specify a color, use '16r' before
the values (e.g. 16rCCFFAA, 16rFFCCFFAA). Use six digits to specify
a color (the way colors are specified in HTML and CSS). When eight
digits are used, the first two characters define the alpha component and the
remainder the red, green, and blue components.

The value for the parameter "gray" must be less than or equal to the current
maximum value as specified by (colorMode). The default maximum value is 255.

To change the color of an image (or a texture), use (tint).



Syntax:
(fill sketch gray)
(fill sketch gray alpha)
(fill sketch value1 value2 value3)
(fill sketch value1 value2 value3 alpha)
(fill sketch color)
(fill sketch color alpha)
(fill sketch hex)
(fill sketch hex alpha)


Parameters:
sketch PApplet
gray int or float: number specifying value between white and black
alpha int or float: opacity of the fill
value1 int or float: red or hue value
value2 int or float: green or saturation value
value3 int or float: blue or brightness value
color color: any value of the color datatype
hex int: color value in hexadecimal notation (i.e. #FFCC00 or 0xFFFFCC00)

Returns:
None

References:
http://processing.org/reference/fill_.html


Examples:

(def sktch (sketch))
(fill sktch "0xFF00FF")
(fill sktch 0xFF 0x00 0xFF)
(fill sktch 255 0 255)

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:596 top

(defn fill
"
  Sets the color used to fill shapes. For example, if you run (fill 204 102 0), all
  subsequent shapes will be filled with orange. This color is either specified in
  terms of the RGB or HSB color depending on the current colorMode() (the default
  color space is RGB, with each value in the range from 0 to 255).

  When using hexadecimal notation to specify a color, use '16r' before
  the values (e.g. 16rCCFFAA, 16rFFCCFFAA). Use six digits to specify
  a color (the way colors are specified in HTML and CSS). When eight
  digits are used, the first two characters define the alpha component and the
  remainder the red, green, and blue components.

  The value for the parameter \"gray\" must be less than or equal to the current
  maximum value as specified by (colorMode). The default maximum value is 255.

  To change the color of an image (or a texture), use (tint).



  Syntax:
    (fill sketch gray)
    (fill sketch gray alpha)
    (fill sketch value1 value2 value3)
    (fill sketch value1 value2 value3 alpha)
    (fill sketch color)
    (fill sketch color alpha)
    (fill sketch hex)
    (fill sketch hex alpha)


  Parameters:
    sketch    PApplet
    gray      int or float: number specifying value between white and black
    alpha     int or float: opacity of the fill
    value1    int or float: red or hue value
    value2    int or float: green or saturation value
    value3    int or float: blue or brightness value
    color     color: any value of the color datatype
    hex int:  color value in hexadecimal notation (i.e. #FFCC00 or 0xFFFFCC00)

  Returns:
    None

  References:
    http://processing.org/reference/fill_.html


  Examples:

    (def sktch (sketch))
    (fill sktch \"0xFF00FF\")
    (fill sktch 0xFF 0x00 0xFF)
    (fill sktch 255 0 255)

"
  ([^PApplet sketch gray]
   (cond
     (string? gray)
       (.fill sketch (color sketch gray))
     (integer? gray)
      (.fill sketch (int gray))
     (float? gray)
      (.fill sketch (float gray))))
  ([^PApplet sketch gray alpha]
   (cond
     (string? gray)
       (.fill sketch (color sketch gray) (int alpha))
     (integer? gray)
      (.fill sketch (int gray) (int alpha))
     (float? gray)
      (.fill sketch (float gray) (float alpha))))
  ([^PApplet sketch x y z]
   (if (or (float? x) (float? y) (float? z))
      (.fill sketch (float x) (float y) (float z))
      (.fill sketch (int x) (int y) (int z))))
  ([^PApplet sketch x y z alpha]
   (if (or (float? x) (float? y) (float? z))
      (.fill sketch (float x) (float y) (float z) (float alpha))
      (.fill sketch (int x) (int y) (int z) (int alpha)))))
Vars in incanter.processing/fill: cond defn float float? int integer? or string?
Used in 0 other vars

Comments top

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