colour.utilities.is_uniform#

colour.utilities.is_uniform(distribution: ArrayLike) bool[source]#

Return whether given distribution is uniform.

Parameters:

distribution (ArrayLike) – Distribution to check the uniformity of.

Returns:

Whether distribution uniform.

Return type:

bool

Examples

Uniformly spaced variable:

>>> a = np.array([1, 2, 3, 4, 5])
>>> is_uniform(a)
True

Non-uniformly spaced variable:

>>> a = np.array([1, 2, 3.1415, 4, 5])
>>> is_uniform(a)
False