PDF

Colored Selections
Introduction
The Colored Selections add-in lets you automatically color all domains or boundaries for easier identification. Colors are selected at random, and you can adjust the tint or shade to your preference. The figure below shows colored selections applied to the domains of a geometry model.
Add-in Library path: COMSOL_Multiphysics/colored_selections
Using the Colored Selections Add-in
The add-in is accessed from a ribbon tab called Colored Selections. After you have added the add-in from the Add-in Libraries, this ribbon tab will be available to the right of the Developer tab (in the Windows operating system), as shown in the figure below.
Using the Select menu, you choose whether to create colored selections for domains or boundaries.
Click the Generate button to generate the colored selections. These are added as a series of Explicit Selections, one for each domain or boundary, with an assigned random color.
The selections are added to a selection group called Colored Domain Selections, for the Domain option, and Colored Boundary Selections, for the Boundary option.
Click the Clear button to remove one of the selection groups. The Select setting will determine which one of the two groups that will be removed.
Click the Settings button to open the Settings window for the add-in, as shown in the figure below.
The colors are created as randomized RGB values sampled from a uniform distribution between 0 and 1 and consequently with the expected value 0.5. The value 0 corresponds to black and the value 1 corresponds to white. These colors may be perceived as too light, and, by default, a certain amount of tint is added to the colors to make them brighter. You can specify the amount of Tint as a number between 0 and 1, where 0 gives the original randomized color and 1 gives a white color. The transformation from the original colors to the tinted ones is given by:
r = (1-tint)*r+tint
g = (1-tint)*g+tint
b = (1-tint)*b+tint
where r, g, and b are the randomized red, green, and blue colors, respectively.
As an alternative you can, in a similar way, specify a certain amount of shade to make the colors darker. First change the Tone setting to Shade, as shown in the figure below.
You can specify the amount of Shade as a number between 0 and 1, where 0 gives the original randomized color and 1 gives a black color. The transformation from the original colors to the shaded ones is described by:
r = (1-shade)*r
g = (1-shade)*g
b = (1-shade)*b
Using shade instead of tint can be useful if you use the Dark color theme option for the user interface.
By default, the random sequence of colors is determined by a preset seed, controlled by the Use random seed checkbox. This will create the same random sequence of color each time. By changing the Random seed value to a different integer you will get a different random sequence of colors. If you clear the Use random seed checkbox, you will get a new random sequence of colors each time you click the Generate button.
The Max selections value specifies the maximum number of Explicit Selections created. If this number is lower than the number of domains or boundaries, the previously generated selections and colors will be reused in a repeating sequence. This can be used to limit the number of feature nodes generated in the Model Builder.
Click the Reset button to reset all settings to their factory values.