usnistgov / NetSimulyzer-ns3-module

A flexible 3D visualizer for displaying, debugging, presenting, and understanding ns-3 scenarios.
Other
33 stars 5 forks source link

Add convenience members for common colors to the Color types #9

Closed bpe2 closed 3 years ago

bpe2 commented 4 years ago

Currently, if a user wants to specify something is red or green then they mush choose a shade themselves and pass the RGB(A) value to the Color3 or Color4 constructors. This may be a little unclear if all colors are specified by numbers like this.

Make the basic cases for colors a bit easier by adding some constants to Color3 and Color4 to build basic colors such as red, green, blue, and gray (maybe more?)

Use would look like the following:

auto errorLog = CreateObject<LogStream> (orchestrator);
errorLog->SetAttribute ("Color", Color3::Red);