Setting colors for Blender collections with the Python API

Since Blender 2.9, the ability to assign color tags has been added for collections. Collection with such tag is displaying in a specific color in the outliner.

The collection color tag value is stored in its “color_tag” property. To change the color label of a collection, we need to assign a certain value to this property.

For example, to mark the current active collection in green:

Or, to mark a collection by its name:

We can assign a color to a collection only from a limited set of colors. All possible color values we can get from its RNA structure:

 

* .blend file with sample code for my Patreon subscribers

5 1 vote
Article Rating
Subscribe
Notify of
guest

0 Comment
Inline Feedbacks
View all comments