colour.RGB_colourspace_visible_spectrum_coverage_MonteCarlo#

colour.RGB_colourspace_visible_spectrum_coverage_MonteCarlo(colourspace: RGB_Colourspace, samples: int = 1000000, random_generator: Callable = random_triplet_generator, random_state: RandomState | None = None) float[source]#

Return given RGB colourspace percentage coverage of visible spectrum volume using Monte Carlo method.

Parameters:
  • colourspace (RGB_Colourspace) – RGB colourspace to compute the visible spectrum coverage percentage.

  • samples (int) – Sample count.

  • random_generator (Callable) – Random triplet generator providing the random samples.

  • random_state (RandomState | None) – Mersenne Twister pseudo-random number generator to use in the random number generator.

Returns:

Percentage coverage of visible spectrum volume.

Return type:

float

Examples

>>> from colour.models import RGB_COLOURSPACE_sRGB as sRGB
>>> prng = np.random.RandomState(2)
>>> RGB_colourspace_visible_spectrum_coverage_MonteCarlo(
...     sRGB, 10e3, random_state=prng
... )  
46...