forked from processing/processing-web-archive
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbackground.xml
More file actions
executable file
·113 lines (84 loc) · 2.86 KB
/
Copy pathbackground.xml
File metadata and controls
executable file
·113 lines (84 loc) · 2.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>background()</name>
<category>Color</category>
<subcategory>Setting</subcategory>
<usage>Web & Application</usage>
<example>
<image>background_.gif</image>
<code><![CDATA[
background(51);
]]></code>
</example>
<example>
<image>background_2.gif</image>
<code><![CDATA[
background(255, 204, 0);
]]></code>
</example>
<example>
<image>background_3.jpg</image>
<code><![CDATA[
PImage b;
b = loadImage("laDefense.jpg");
background(b);
]]></code>
</example>
<description><![CDATA[
The <b>background()</b> function sets the color used for the background of the Processing window. The default background is light gray. In the <b>draw()</b> function, the background color is used to clear the display window at the beginning of each frame.
<br/> <br/>
An image can also be used as the background for a sketch, however its width and height must be the same size as the sketch window. To resize an image 'b' to the size of the sketch window, use b.resize(width, height).
<br/> <br/>
Images used as background will ignore the current tint() setting.
<br/> <br/>
It is not possible to use transparency (alpha) in background colors with the main drawing surface, however they will work properly with <b>createGraphics</b>.
]]></description>
<syntax><![CDATA[
background(<kbd>gray</kbd>)
background(<kbd>gray</kbd>, <kbd>alpha</kbd>)
background(<kbd>value1</kbd>, <kbd>value2</kbd>, <kbd>value3</kbd>)
background(<kbd>value1</kbd>, <kbd>value2</kbd>, <kbd>value3</kbd>, <kbd>alpha</kbd>)
background(<kbd>color</kbd>)
background(<kbd>color</kbd>, <kbd>alpha</kbd>)
background(<kbd>hex</kbd>)
background(<kbd>hex</kbd>, <kbd>alpha</kbd>)
]]></syntax>
<parameter>
<label>gray</label>
<description><![CDATA[int or float: specifies a value between white and black]]></description>
</parameter>
<parameter>
<label>alpha</label>
<description><![CDATA[int or float: opacity of the background]]></description>
</parameter>
<parameter>
<label>value1</label>
<description><![CDATA[int or float: red or hue value (depending on the current color mode)]]></description>
</parameter>
<parameter>
<label>value2</label>
<description><![CDATA[int or float: green or saturation value (depending on the current color mode)]]></description>
</parameter>
<parameter>
<label>value3</label>
<description><![CDATA[int or float: blue or brightness value (depending on the current color mode)]]></description>
</parameter>
<parameter>
<label>color</label>
<description><![CDATA[color: any value of the color datatype]]></description>
</parameter>
<parameter>
<label>hex</label>
<description><![CDATA[int: color value in hexadecimal notation (i.e. #FFCC00 or 0xFFFFCC00)]]></description>
</parameter>
<returns>None</returns>
<related>
stroke()
fill()
tint()
colorMode()
</related>
<availability>1.0</availability>
<type>Function</type>
<partof>Core</partof>
</root>