colour_visuals.VisualRGBColourspace2D#

class colour_visuals.VisualRGBColourspace2D(colourspace: RGB_Colourspace | str | Sequence[RGB_Colourspace | LiteralRGBColourspace | str] = 'sRGB', method: Literal['CIE 1931', 'CIE 1960 UCS', 'CIE 1976 UCS'] | str = 'CIE 1931', colours: ArrayLike | None = None, opacity: float = 1, thickness: float = 1)[source]#

Bases: Group

Create a 2D RGB colourspace gamut visual.

Parameters:
  • colourspace (RGB_Colourspace | str | Sequence[RGB_Colourspace | LiteralRGBColourspace | str]) – RGB colourspace to plot the gamut of. colourspaces elements can be of any type or form supported by the colour.plotting.common.filter_RGB_colourspaces() 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.

  • thickness (float) – Thickness of the visual lines.

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 = VisualRGBColourspace2D()
...     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)
...
visual-rgbcolourspace-2-d
__init__(colourspace: RGB_Colourspace | str | Sequence[RGB_Colourspace | LiteralRGBColourspace | str] = 'sRGB', method: Literal['CIE 1931', 'CIE 1960 UCS', 'CIE 1976 UCS'] | str = 'CIE 1931', colours: ArrayLike | None = None, opacity: float = 1, thickness: float = 1)[source]#
Parameters:
  • colourspace (RGB_Colourspace | str | Sequence[RGB_Colourspace | LiteralRGBColourspace | str]) –

  • method (Literal['CIE 1931', 'CIE 1960 UCS', 'CIE 1976 UCS'] | str) –

  • colours (ArrayLike | None) –

  • opacity (float) –

  • thickness (float) –