Color Picker

Within PlantUML you are able to assign colors to an object or connector by using the the following values:

  • Hex RGB value eg #AABBCC
  • Standard HTML Colors eg #LightBlue
  • Special PlantUML names i.e. Application, Implementation, Motivation, Physical & Technology

Managing colors in EA is quite a complex topic. Each element type has a default color and it is also possible to apply default colors based on stereotype (via UML type setting or MDG UML Profile) or via shape scripts and driven possibly by a tagged value.

A modeller can override a default cold via the GUI using color palette.

Behind the scenes, Enterprise Architect will store the value of -1 if a default color is to be applied. If the default has been updated by the modeller, then the value is a decimal representation of the Blue Green Red components of the color is stored.

Hence the need to have a sub routine to allow a PlantUML color code to be converted into the decimal equivalent to be applied to an EA modelling element during the Create Sequence Diagram script.

Likewise when Generating the PlantUML script there is a requirement to take the decimal version and output the #colorname or #rrggbb value.

Refer to thepost relating to how to Create a Sequence Diagram for details of location of the color-picker script and the installation instructions.

The common functions available are:

  • ColorHexByName (colorName) where a #colorname is supplied as input and the hex RGB value is returned
  • ColorNameByHex (colorHex) where a hex RGB is supplied and the color name, if exists is returned