colour.utilities.is_uniform#

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

Determine whether the specified distribution is uniform.

Parameters:

distribution (ArrayLike) – Distribution to check for uniformity.

Returns:

Whether the distribution is 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