colour_visuals.VisualGrid#
- class colour_visuals.VisualGrid(size: int = 20, major_grid_colours: ArrayLike = np.array([0.5, 0.5, 0.5]), minor_grid_colours: ArrayLike = np.array([0.25, 0.25, 0.25]), major_tick_labels=True, major_tick_label_colours: ArrayLike = np.array([0.75, 0.75, 0.75]), minor_tick_labels=True, minor_tick_label_colours: ArrayLike = np.array([0.5, 0.5, 0.5]))[source]#
Bases:
Group
Create a 3D grid.
- Parameters:
size (int) – Size of the grid.
major_grid_colours (ArrayLike) – Colours of the major grid lines.
minor_grid_colours (ArrayLike) – Colours of the minor grid lines.
major_tick_labels – Whether to draw the major tick labels.
major_tick_label_colours (ArrayLike) – Colours of the major tick labels.
minor_tick_labels – Whether to draw the minor tick labels.
minor_tick_label_colours (ArrayLike) – Colours of the minor tick labels.
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 = VisualGrid() ... 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__(size: int = 20, major_grid_colours: ArrayLike = np.array([0.5, 0.5, 0.5]), minor_grid_colours: ArrayLike = np.array([0.25, 0.25, 0.25]), major_tick_labels=True, major_tick_label_colours: ArrayLike = np.array([0.75, 0.75, 0.75]), minor_tick_labels=True, minor_tick_label_colours: ArrayLike = np.array([0.5, 0.5, 0.5]))[source]#
- Parameters:
size (int) –
major_grid_colours (ArrayLike) –
minor_grid_colours (ArrayLike) –
major_tick_label_colours (ArrayLike) –
minor_tick_label_colours (ArrayLike) –