colour_visuals.VisualChromaticityDiagram#
- class colour_visuals.VisualChromaticityDiagram(cmfs: MultiSpectralDistributions | str | Sequence[MultiSpectralDistributions | str] = 'CIE 1931 2 Degree Standard Observer', method: Literal['CIE 1931', 'CIE 1960 UCS', 'CIE 1976 UCS'] | str = 'CIE 1931', colours: ArrayLike | None = None, opacity: float = 1, material: Type[gfx.MeshAbstractMaterial] = gfx.MeshBasicMaterial, wireframe: bool = False, samples: int = 64)[source]#
Bases:
Mesh
Create a Chromaticity Diagram visual.
- Parameters:
cmfs (MultiSpectralDistributions | str | Sequence[MultiSpectralDistributions | str]) – Standard observer colour matching functions used for computing the spectrum domain and colours.
cmfs
can be of any type or form supported by thecolour.plotting.common.filter_cmfs()
definition.method (Literal['CIE 1931', 'CIE 1960 UCS', 'CIE 1976 UCS'] | str) – Chromaticity Diagram method.
colours (ArrayLike | None) – Colours of the visual, if None, the colours are computed from the visual geometry.
opacity (float) – Opacity of the visual.
material (Type[gfx.MeshAbstractMaterial]) – Material used to surface the visual geomeetry.
wireframe (bool) – Whether to render the visual as a wireframe, i.e., only render edges.
samples (int) – Samples count used for generating the Chromaticity Diagram Delaunay tesselation.
Examples
>>> import os >>> from colour.utilities import suppress_stdout >>> from wgpu.gui.auto import WgpuCanvas >>> with suppress_stdout(): ... canvas = WgpuCanvas(size=(960, 540)) ... scene = gfx.Scene() ... scene.add( ... gfx.Background( ... None, gfx.BackgroundMaterial(np.array([0.18, 0.18, 0.18])) ... ) ... ) ... visual = VisualChromaticityDiagram() ... camera = gfx.PerspectiveCamera(50, 16 / 9) ... camera.show_object(visual, up=np.array([0, 0, 1]), scale=1.25) ... scene.add(visual) ... if os.environ.get("CI") is None: ... gfx.show(scene, camera=camera, canvas=canvas) ...
- __init__(cmfs: MultiSpectralDistributions | str | Sequence[MultiSpectralDistributions | str] = 'CIE 1931 2 Degree Standard Observer', method: Literal['CIE 1931', 'CIE 1960 UCS', 'CIE 1976 UCS'] | str = 'CIE 1931', colours: ArrayLike | None = None, opacity: float = 1, material: Type[gfx.MeshAbstractMaterial] = gfx.MeshBasicMaterial, wireframe: bool = False, samples: int = 64)[source]#