AverageColor
Computes the average colour in a pixmap or a part of a pixmap.
Syntax
-
AverageColor(pm[, x, y, w, h])
-
pm
is a pixmap -
x, y, w, h
are non-negative integers
-
Description
AverageColor(pm)
returns the RGB average colour in pm
.
AverageColor(pm, x, y, w, h)
returns the RGB average colour in the rectangular part of pm
with top-left corner (x, y)
, width w
and height h
.
Examples
S ≔ ExampleData("Sally")
AverageColor(S)
rgba(0.338, 0.346, 0.189, 1.000) (#565830)
AverageColor(S, 65, 0, 50, 360)
rgba(0.912, 0.259, 0.022, 1.000) (#E84206)