napari.utils.Colormap#

class napari.utils.Colormap(colors, display_name: str | None = None, *, name: str = 'custom', interpolation: ColormapInterpolationMode = ColormapInterpolationMode.LINEAR, controls: Array = None)[source]#

Bases: EventedModel

Colormap that relates intensity values to colors.

colors#

Data used in the colormap.

Type:

array, shape (N, 4)

name#

Name of the colormap.

Type:

str

_display_name#

Display name of the colormap.

Type:

str

controls#

Control points of the colormap.

Type:

array, shape (N,) or (N+1,)

interpolation#

Colormap interpolation mode, either ‘linear’ or ‘zero’. If ‘linear’, ncontrols = ncolors (one color per control point). If ‘zero’, ncontrols = ncolors+1 (one color per bin).

Type:

str

Inherited-members:

Methods

construct([_fields_set])

Creates a new model setting __dict__ and __fields_set__ from trusted or pre-validated data.

copy(*[, include, exclude, update, deep])

Duplicate a model, optionally choose which fields to include, exclude and change.

dict(*[, include, exclude, by_alias, ...])

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

enums_as_values([as_values])

Temporarily override how enums are retrieved.

from_orm(obj)

json(*[, include, exclude, by_alias, ...])

Generate a JSON representation of the model, include and exclude arguments as per dict().

map(values)

parse_file(path, *[, content_type, ...])

parse_obj(obj)

parse_raw(b, *[, content_type, encoding, ...])

reset()

Reset the state of the model to default values.

schema([by_alias, ref_template])

schema_json(*[, by_alias, ref_template])

update(values[, recurse])

Update a model in place.

update_forward_refs(**localns)

Try to update ForwardRefs on fields based on this Model, globalns and localns.

validate(value)

Attributes

colorbar

events

Details