check_attribute_color_range#

k3d.helpers.check_attribute_color_range(attribute, color_range=())[source]#

Return color range versus provided attribute.

Parameters
  • attribute (list or dict (for timeseries)) – Array of numbers.

  • color_range (tuple, optional) – Two numbers, by default ().

Returns

Color range.

Return type

tuple

Examples#

Color range#

import k3d
import numpy as np

attribute = np.linspace(0, 0.5, 100)

color_range = k3d.helpers.check_attribute_range(attribute, color_range=[0, 1])

"""
(0, 1)
"""

No color range#

import k3d
import numpy as np

attribute = np.linspace(0, 0.5, 100)

color_range = k3d.helpers.check_attribute_range(attribute)

"""
(0.0, 0.5)
"""