mirror of
https://github.com/processing/processing4.git
synced 2026-02-12 10:00:42 +01:00
91 lines
2.1 KiB
XML
91 lines
2.1 KiB
XML
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
<root>
|
|
<name>fill()</name>
|
|
|
|
<category>Color</category>
|
|
|
|
<subcategory>Setting</subcategory>
|
|
|
|
<usage>Web & Application</usage>
|
|
|
|
<example>
|
|
<image>fill_.gif</image>
|
|
<code>
|
|
fill(153);
|
|
rect(30, 20, 55, 55);
|
|
</code>
|
|
</example>
|
|
|
|
<example>
|
|
<image>fill_2.gif</image>
|
|
<code>
|
|
fill(204, 102, 0);
|
|
rect(30, 20, 55, 55);
|
|
</code>
|
|
</example>
|
|
|
|
<description>
|
|
Sets the color used to fill shapes. For example, if you call <b>fill(204, 102, 0)</b> and draw a rectangle it will be filled with orange. This color is either specified in terms of the RGB or HSB color depending on the current <b>colorMode()</b>. The default color space is RGB, with each value in the range from 0 to 255. The version of <b>fill()</b> with one parameter specifies a gray value, the version with three parameters specifies a color, and the version with four parameters specifies a color with an alpha value. <i>Note: the value for the parameter "gray" must be less than or equal to the current maximum value as specified by <b>colorMode()</b>. The default value is 255.</i>
|
|
</description>
|
|
|
|
<syntax>
|
|
fill(<c>gray</c>)
|
|
fill(<c>gray</c>, <c>alpha</c>)
|
|
fill(<c>value1</c>, <c>value2</c>, <c>value3</c>)
|
|
fill(<c>color</c>)
|
|
fill(<c>color</c>, <c>alpha</c>)
|
|
fill(<c>value1</c>, <c>value2</c>, <c>value3</c>, <c>alpha</c>)
|
|
</syntax>
|
|
|
|
<parameter>
|
|
<label>gray</label>
|
|
<description>int or float: number specifying value between white and black</description>
|
|
</parameter>
|
|
|
|
<parameter>
|
|
<label>value1</label>
|
|
<description>int or float: red or hue value</description>
|
|
</parameter>
|
|
|
|
<parameter>
|
|
<label>value2</label>
|
|
<description>int or float: green or saturation value</description>
|
|
</parameter>
|
|
|
|
<parameter>
|
|
<label>value3</label>
|
|
<description>int or float: blue or brightness value</description>
|
|
</parameter>
|
|
|
|
<parameter>
|
|
<label>alpha</label>
|
|
<description>int or float: opacity of the fill</description>
|
|
</parameter>
|
|
|
|
<parameter>
|
|
<label>color</label>
|
|
<description>color: any value of the color datatype</description>
|
|
</parameter>
|
|
|
|
<returns>None</returns>
|
|
|
|
<related>
|
|
noFill()
|
|
colorMode()
|
|
</related>
|
|
|
|
<availability>1.0</availability>
|
|
|
|
<type>Function</type>
|
|
|
|
<partof>Core</partof>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</root>
|