You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 51acae9
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: Reference/api_en/set.xml
+16-1Lines changed: 16 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -45,12 +45,21 @@ Changes the color of any pixel, or writes an image directly to the display windo
45
45
<br />
46
46
The <b>x</b> and <b>y</b> parameters specify the pixel to change and the <b>c</b> parameter specifies the color value. The <b>c</b> parameter is interpreted according to the current color mode. (The default color mode is RGB values from 0 to 255.) When setting an image, the <b>x</b> and <b>y</b> parameters define the coordinates for the upper-left corner of the image, regardless of the current <b>imageMode()</b>.
47
47
<br /><br />
48
-
Setting the color of a single pixel with <b>set(x, y)</b> is easy, but not as fast as putting the data directly into <b>pixels</b>. The equivalent statement to <b>set(x, y, #000000)</b> using <b>pixels</b> is <b>pixels[y*width+x] = #000000</b>. See the reference for <a href="pixels.html">pixels</a> for more information.
48
+
Setting the color of a single pixel with <b>set(x, y)</b> is easy, but not as
49
+
fast as putting the data directly into <b>pixels</b>. The equivalent statement
50
+
to <b>set(x, y, #000000)</b> using <b>pixels</b> is <b>pixels[y*width+x] =
51
+
#000000</b>. See the reference for <a href="pixels.html">pixels</a> for more
52
+
information.<br />
53
+
<br />
54
+
While set(r, g, b) changes pixel color, s = set([1, 1, 3]) is a Python function
55
+
for converting a single list or tuple into int a set of unique keys: {1, 3}.
56
+
Sets in this sense may also be created using curly braces: s = {1, 2, 3}.
0 commit comments