Skip to content

Comments

Add four Visualizer colormap function and png files#4737

Open
smathimech wants to merge 5 commits intomodelica:masterfrom
smathimech:colormap_#4689
Open

Add four Visualizer colormap function and png files#4737
smathimech wants to merge 5 commits intomodelica:masterfrom
smathimech:colormap_#4689

Conversation

@smathimech
Copy link

@smathimech smathimech commented Feb 12, 2026

This MR address this issue #4689

Details:

  • Added four different colormap function for visualizer.
  • Conversion script not requires (adding new function).

@CLAassistant
Copy link

CLAassistant commented Feb 12, 2026

CLA assistant check
All committers have signed the CLA.

@smathimech smathimech closed this Feb 12, 2026
@smathimech smathimech reopened this Feb 12, 2026
@smathimech
Copy link
Author

smathimech commented Feb 12, 2026

This is my first contribution to this modelica repository. I'm part of Modelon, India. I hope that, signed the CLA correctly.

@thorade
Copy link
Contributor

thorade commented Feb 12, 2026

Mathi, thanks for adding these colormaps. You used two email addresses while committing, can you add the second address also to your github profile?

The existing colormaps are all in this overview/comparison, maybe the new maps could be added there as well?
https://github.com/modelica/ModelicaStandardLibrary/blob/master/Modelica/Resources/Images/Mechanics/MultiBody/Visualizers/Colors/ColorMaps/ColorMaps.png

@smathimech
Copy link
Author

ColorMaps

Since i don't the original source file of this colormap, it's quite difficult to get similar represenations. Let me know, if this need to improved further.

Copy link
Contributor

@tobolar tobolar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this contribution. Please consider my comments below (resctricted to Modelica.Mechanics.MultiBody.Visualizers.Colors.ColorMaps).

  1. The definition of Plasma and Viridis seems to be identical.

  2. TrafficlightColor can even be renamed to TrafficLight.

  3. Function name shall start with a lower case letter (see Modelica.UsersGuide.Conventions.ModelicaCode.Naming):

    • CoolWarm -> coolWarm
    • TrafficlightColor similarly
    • Plasma similarly
    • Viridis similarly

    When renamed, please update also figure Modelica/Resources/Images/Mechanics/MultiBody/Visualizers/Colors/ColorMaps/ColorMaps.png accordingly.

  4. Class description string is missing in

    • TrafficlightColor
    • Plasma
    • Viridis
  5. For TrafficlightColor, maybe the default n_colors=3 makes more sense.

@smathimech
Copy link
Author

Thanks for this contribution. Please consider my comments below (resctricted to Modelica.Mechanics.MultiBody.Visualizers.Colors.ColorMaps).

  1. The definition of Plasma and Viridis seems to be identical.

  2. TrafficlightColor can even be renamed to TrafficLight.

  3. Function name shall start with a lower case letter (see Modelica.UsersGuide.Conventions.ModelicaCode.Naming):

    • CoolWarm -> coolWarm
    • TrafficlightColor similarly
    • Plasma similarly
    • Viridis similarly

    When renamed, please update also figure Modelica/Resources/Images/Mechanics/MultiBody/Visualizers/Colors/ColorMaps/ColorMaps.png accordingly.

  4. Class description string is missing in

    • TrafficlightColor
    • Plasma
    • Viridis
  5. For TrafficlightColor, maybe the default n_colors=3 makes more sense.

Thanks for the comments.

  1. Both colormap might identical, but it might be have some use case.
  2. Renamed to TrafficLight.
  3. All four function name start's with small letter.
  4. updated the figure and string description details as well.
  5. For TrafficLight, have applied the modifier n_colors=3.

@smathimech smathimech requested a review from tobolar February 20, 2026 11:18
@beutlich beutlich changed the title Added four Visualizer colormap function and png files Add four Visualizer colormap function and png files Feb 22, 2026
@beutlich beutlich added enhancement New feature or enhancement L: Mechanics.MultiBody Issue addresses Modelica.Mechanics.MultiBody labels Feb 22, 2026
@beutlich beutlich added this to the MSL4.2.0 milestone Feb 22, 2026
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any chance to regenerate all 11 color maps to have consistent font and color gradients?

Copy link
Author

@smathimech smathimech Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ColorMaps

Tried to re‑create or closely match all text styles, and the figure has been updated accordingly. If it look well, then it can be commited.

@tobolar
Copy link
Contributor

tobolar commented Feb 24, 2026

  1. For TrafficLight, have applied the modifier n_colors=3.

Please change also the documentation. "The default value is "n_colors=64" (it is usually best if n_colors is a multiple of 4)." does not more fit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or enhancement L: Mechanics.MultiBody Issue addresses Modelica.Mechanics.MultiBody

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants