diff --git a/additional_notes/0.4.19/api changes.md b/additional_notes/0.4.19/api changes.md new file mode 100644 index 0000000..2ece546 --- /dev/null +++ b/additional_notes/0.4.19/api changes.md @@ -0,0 +1,15 @@ + +[#6102](https://github.com/napari/napari/pull/6102) added the ability to set +linear colormaps from black to a named color by using `colormap="color-name"` +syntax. It turns out that "orange" is both the name of a +white-to-orange colormap in VisPy, and one of the color names in the color +dictionary, therefore implicitly a *black-to-orange* colormap! We decided to use +the new, color-name behavior in this update. So if you are wondering why your +`imshow(data, colormap='orange')` calls look different — this is why. + +In [#6178](https://github.com/napari/napari/pull/6178), the "action" type of +events emitted when editing Shapes or Points was changed to be more granular. +The types are no longer "add", "remove", and "change", but "adding", "added", +"removing", "removed", "changing", and "changed". This gives listeners more +control over when to take action in response to an event. + diff --git a/additional_notes/0.4.19/deprecations.md b/additional_notes/0.4.19/deprecations.md new file mode 100644 index 0000000..4d99183 --- /dev/null +++ b/additional_notes/0.4.19/deprecations.md @@ -0,0 +1,21 @@ +[#6542](https://github.com/napari/napari/pull/6542) made a number of +deprecations to the Labels API to simplify it. Rather than having color-related +properties strewn all over the layer, color control is moved strictly to the +layer's `colormap`. Here is the full list of deprecated attributes and their +replacements: + +- num_colors: `layer.num_colors` becomes `len(layer.colormap)`. + `layer.num_colors = n` becomes `layer.colormap = label_colormap(n)`. +- `napari.utils.colormaps.LabelColormap` is deprecated and has been renamed to + `napari.utils.colormaps.CyclicLabelColormap`. +- color: `layer.color` becomes `layer.colormap.color_dict`. + `layer.color = color_dict` becomes + `layer.colormap = DirectLabelColormap(color_dict)`. +- _background_label: `layer._background_label` is now at + `layer.colormap.background_value`. +- color_mode: `layer.color_mode` is set by setting the colormap using the + corresponding colormap type (`CyclicLabelColormap` or `DirectLabelColormap`; + these classes can be imported from `napari.utils.colormaps`.). +- `seed`: was only used for shifting labels around in [0, 1]. It is + superseded by `layer.new_colormap()` which was implemented in + [#6460](https://github.com/napari/napari/pull/6460). diff --git a/additional_notes/0.4.19/highlights.md b/additional_notes/0.4.19/highlights.md index 55899dc..2a1f445 100644 --- a/additional_notes/0.4.19/highlights.md +++ b/additional_notes/0.4.19/highlights.md @@ -71,11 +71,8 @@ available, see the RGB hex color prefixed with `#`, as in `napari.imshow(data, colormap=`#88ff1a`)`. -(Amusing side note/API break: it turns out that "orange" is both the name of a -white-to-orange colormap in VisPy, and one of the color names in the color -dictionary, which then produces a *black-to-orange* colormap! We decided to use -the new, color-name behavior in this update. So if you are wondering why your -`imshow(data, colormap='orange')` calls look different — this is why.) +(For an amusing side note, though, check out the [API Changes](#api-changes) +note related to this PR. 😅) ### Some technical stuff