colour.colorimetry.cmfs Module

Colour Matching Functions

Defines colour matching functions classes for the dataset from colour.colorimetry.dataset.cmfs:

See also

Colour Matching Functions IPython Notebook colour.colorimetry.dataset.cmfs, colour.colorimetry.spectrum.TriSpectralPowerDistribution

class colour.colorimetry.cmfs.LMS_ConeFundamentals(name, data, title=None)[source]

Bases: colour.colorimetry.spectrum.TriSpectralPowerDistribution

Implements support for the Stockman and Sharpe LMS cone fundamentals colour matching functions.

Parameters:
  • name (unicode) – LMS colour matching functions name.
  • data (dict) – LMS colour matching functions.
  • title (unicode, optional) – LMS colour matching functions title for figures.
l_bar
m_bar
s_bar
__repr__()[source]

Returns a formatted string representation of the LMS cone fundamentals colour matching functions.

Returns:Formatted string representation.
Return type:unicode

Notes

Examples

>>> l_bar = {510: 49.67, 520: 69.59, 530: 81.73, 540: 88.19}
>>> m_bar = {510: 90.56, 520: 87.34, 530: 45.76, 540: 23.45}
>>> s_bar = {510: 12.43, 520: 23.15, 530: 67.98, 540: 90.28}
>>> data = {'l_bar': l_bar, 'm_bar': m_bar, 's_bar': s_bar}
>>> LMS_ConeFundamentals(  
...     'LMS CMFS', data, '*LMS* Cone Fundamentals')
LMS_ConeFundamentals(
    'LMS CMFS',
    {...'l_bar': {510...: 49.67, 520...: 69.59, 530...: 81.73, 540...: 88.19},
     ...'m_bar': {510...: 90.56, 520...: 87.34, 530...: 45.76, 540...: 23.45},
     ...'s_bar': {510...: 12.43, 520...: 23.15, 530...: 67.98, 540...: 90.28}},
    '*LMS* Cone Fundamentals')
l_bar

Property for self.x attribute.

Returns:self.x
Return type:SpectralPowerDistribution

Warning

LMS_ConeFundamentals.l_bar is read only.

m_bar

Property for self.y attribute.

Returns:self.y
Return type:SpectralPowerDistribution

Warning

LMS_ConeFundamentals.m_bar is read only.

s_bar

Property for self.z attribute.

Returns:self.z
Return type:SpectralPowerDistribution

Warning

LMS_ConeFundamentals.s_bar is read only.

class colour.colorimetry.cmfs.RGB_ColourMatchingFunctions(name, data, title=None)[source]

Bases: colour.colorimetry.spectrum.TriSpectralPowerDistribution

Implements support for the CIE RGB colour matching functions.

Parameters:
  • name (unicode) – CIE RGB colour matching functions name.
  • data (dict) – CIE RGB colour matching functions.
  • title (unicode, optional) – CIE RGB colour matching functions title for figures.
r_bar
g_bar
b_bar
__repr__()[source]

Returns a formatted string representation of the CIE RGB colour matching functions.

Returns:Formatted string representation.
Return type:unicode

Notes

Examples

>>> r_bar = {510: 49.67, 520: 69.59, 530: 81.73, 540: 88.19}
>>> g_bar = {510: 90.56, 520: 87.34, 530: 45.76, 540: 23.45}
>>> b_bar = {510: 12.43, 520: 23.15, 530: 67.98, 540: 90.28}
>>> data = {'r_bar': r_bar, 'g_bar': g_bar, 'b_bar': b_bar}
>>> RGB_ColourMatchingFunctions(  
...     'RGB CMFS', data, '*RGB* CMFS')
RGB_ColourMatchingFunctions(
    'RGB CMFS',
    {...'b_bar': {510...: 12.43, 520...: 23.15, 530...: 67.98, 540...: 90.28},
     ...'g_bar': {510...: 90.56, 520...: 87.34, 530...: 45.76, 540...: 23.45},
     ...'r_bar': {510...: 49.67, 520...: 69.59, 530...: 81.73, 540...: 88.19}},
    '*RGB* CMFS')
b_bar

Property for self.z attribute.

Returns:self.z
Return type:SpectralPowerDistribution

Warning

RGB_ColourMatchingFunctions.b_bar is read only.

g_bar

Property for self.y attribute.

Returns:self.y
Return type:SpectralPowerDistribution

Warning

RGB_ColourMatchingFunctions.g_bar is read only.

r_bar

Property for self.x attribute.

Returns:self.x
Return type:SpectralPowerDistribution

Warning

RGB_ColourMatchingFunctions.r_bar is read only.

class colour.colorimetry.cmfs.XYZ_ColourMatchingFunctions(name, data, title=None)[source]

Bases: colour.colorimetry.spectrum.TriSpectralPowerDistribution

Implements support for the CIE Standard Observers XYZ colour matching functions.

Parameters:
  • name (unicode) – CIE Standard Observer XYZ colour matching functions name.
  • data (dict) – CIE Standard Observer XYZ colour matching functions.
  • title (unicode, optional) – CIE Standard Observer XYZ colour matching functions title for figures.
x_bar
y_bar
z_bar
__repr__()[source]

Returns a formatted string representation of the XYZ colour matching functions.

Returns:Formatted string representation.
Return type:unicode

Notes

Examples

>>> x_bar = {510: 49.67, 520: 69.59, 530: 81.73, 540: 88.19}
>>> y_bar = {510: 90.56, 520: 87.34, 530: 45.76, 540: 23.45}
>>> z_bar = {510: 12.43, 520: 23.15, 530: 67.98, 540: 90.28}
>>> data = {'x_bar': x_bar, 'y_bar': y_bar, 'z_bar': z_bar}
>>> XYZ_ColourMatchingFunctions(  
...     'XYZ CMFS', data, '*XYZ* CMFS')
XYZ_ColourMatchingFunctions(
    'XYZ CMFS',
    {...'x_bar': {510...: 49.67, 520...: 69.59, 530...: 81.73, 540...: 88.19},
     ...'y_bar': {510...: 90.56, 520...: 87.34, 530...: 45.76, 540...: 23.45},
     ...'z_bar': {510...: 12.43, 520...: 23.15, 530...: 67.98, 540...: 90.28}},
    '*XYZ* CMFS')
x_bar

Property for self.x attribute.

Returns:self.x
Return type:SpectralPowerDistribution

Warning

XYZ_ColourMatchingFunctions.x_bar is read only.

y_bar

Property for self.y attribute.

Returns:self.y
Return type:SpectralPowerDistribution

Warning

XYZ_ColourMatchingFunctions.y_bar is read only.

z_bar

Property for self.z attribute.

Returns:self.z
Return type:SpectralPowerDistribution

Warning

XYZ_ColourMatchingFunctions.z_bar is read only.