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
Copy file name to clipboardExpand all lines: docs/reST/ref/color.rst
+9Lines changed: 9 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -226,6 +226,15 @@
226
226
227
227
.. ## Color.set_length ##
228
228
229
+
..method::grayscale
230
+
231
+
|:sl:`returns the grayscale of a Color`
232
+
|:sg:`grayscale() -> Color`
233
+
234
+
Returns a Color which represents the grayscaled version of self using the luminosity formula which weights red, green and blue according to their wavelengths..
235
+
236
+
.. ## Color.grayscale ##
237
+
229
238
..method::lerp
230
239
231
240
|:sl:`returns a linear interpolation to the given Color.`
Copy file name to clipboardExpand all lines: src_c/doc/transform_doc.h
+5Lines changed: 5 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -14,6 +14,7 @@
14
14
#defineDOC_PYGAMETRANSFORMLAPLACIAN "laplacian(surface, dest_surface=None) -> Surface\nfind edges in a surface"
15
15
#defineDOC_PYGAMETRANSFORMAVERAGESURFACES "average_surfaces(surfaces, dest_surface=None, palette_colors=1) -> Surface\nfind the average surface from many surfaces."
16
16
#defineDOC_PYGAMETRANSFORMAVERAGECOLOR "average_color(surface, rect=None, consider_alpha=False) -> Color\nfinds the average color of a surface"
17
+
#defineDOC_PYGAMETRANSFORMGRAYSCALE "grayscale(surface, dest_surface=None) -> Surface\ngrayscale a surface"
17
18
#defineDOC_PYGAMETRANSFORMTHRESHOLD "threshold(dest_surface, surface, search_color, threshold=(0,0,0,0), set_color=(0,0,0,0), set_behavior=1, search_surf=None, inverse_set=False) -> num_threshold_pixels\nfinds which, and how many pixels in a surface are within a threshold of a 'search_color' or a 'search_surf'."
18
19
19
20
@@ -80,6 +81,10 @@ pygame.transform.average_color
80
81
average_color(surface, rect=None, consider_alpha=False) -> Color