colour.plotting.models.colourspace_model_axis_reorder#
- colour.plotting.models.colourspace_model_axis_reorder(a: ArrayLike, model: LiteralColourspaceModel | str, direction: Literal['Forward', 'Inverse'] | str = 'Forward') NDArrayFloat [source]#
Reorder the axes of given colourspace model \(a\) array according to the most common volume plotting axes order.
- Parameters:
a (ArrayLike) – Colourspace model \(a\) array.
model (LiteralColourspaceModel | str) – Colourspace model, see
colour.COLOURSPACE_MODELS
attribute for the list of supported colourspace models.direction (Literal['Forward', 'Inverse'] | str) – Reordering direction.
- Returns:
Reordered colourspace model \(a\) array.
- Return type:
Examples
>>> a = np.array([0, 1, 2]) >>> colourspace_model_axis_reorder(a, "CIE Lab") array([ 1., 2., 0.]) >>> colourspace_model_axis_reorder(a, "IPT") array([ 1., 2., 0.]) >>> colourspace_model_axis_reorder(a, "OSA UCS") array([ 1., 2., 0.]) >>> b = np.array([1, 2, 0]) >>> colourspace_model_axis_reorder(b, "OSA UCS", "Inverse") array([ 0., 1., 2.])