colour.utilities.from_range_10

colour.utilities.from_range_10(a, scale_factor=10)[source]

Scales given array \(a\) from range ‘10’, used by Munsell Renotation System. The behaviour is as follows:

  • If Colour domain-range scale is ‘Reference’, the definition is entirely by-passed.

  • If Colour domain-range scale is ‘1’, array \(a\) is divided by scale_factor, typically 10.

  • If Colour domain-range scale is ‘100’ (currently unsupported private value only used for unit tests), array \(a\) is multiplied by scale_factor, typically 10.

Parameters
  • a (array_like) – \(a\) to scale from range ‘10’.

  • scale_factor (numeric or array_like, optional) – Scale factor, usually numeric but can be an array_like if some axis need different scaling to be brought from range ‘10’.

Returns

\(a\) scaled from range ‘10’.

Return type

ndarray

Warning

The scale conversion of \(a\) variable happens in-place, i.e. \(a\) will be mutated!

Examples

With Colour domain-range scale set to ‘Reference’:

>>> with domain_range_scale('Reference'):
...     from_range_10(1)
1

With Colour domain-range scale set to ‘1’:

>>> with domain_range_scale('1'):
...     from_range_10(1)
0.1

With Colour domain-range scale set to ‘100’ (unsupported):

>>> with domain_range_scale('100'):
...     from_range_10(1)
10