Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions hydra_visualizer/src/color/colormap_utilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,22 @@ std::function<Color(size_t)> lookupColormap(DiscretePalette cmap) {
}
}

static const auto enum_init =
config::Enum<NamedColors>::Initializer(std::map<NamedColors, std::string>{
{NamedColors::BLACK, "black"},
{NamedColors::WHITE, "white"},
{NamedColors::RED, "red"},
{NamedColors::GREEN, "green"},
{NamedColors::BLUE, "blue"},
{NamedColors::YELLOW, "yellow"},
{NamedColors::ORANGE, "orange"},
{NamedColors::PURPLE, "purple"},
{NamedColors::CYAN, "cyan"},
{NamedColors::MAGENTA, "magenta"},
{NamedColors::PINK, "pink"},
{NamedColors::GRAY, "gray"},
});

} // namespace

spark_dsg::Color colorFromName(NamedColors color) {
Expand Down
34 changes: 2 additions & 32 deletions hydra_visualizer/src/layer_info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,22 +72,7 @@ void declare_config(LayerConfig::Edges& config) {
field(config.draw, "draw");
field(config.scale, "scale");
field(config.alpha, "alpha");
enum_field(config.color,
"color",
{
{NamedColors::BLACK, "black"},
{NamedColors::WHITE, "white"},
{NamedColors::RED, "red"},
{NamedColors::GREEN, "green"},
{NamedColors::BLUE, "blue"},
{NamedColors::YELLOW, "yellow"},
{NamedColors::ORANGE, "orange"},
{NamedColors::PURPLE, "purple"},
{NamedColors::CYAN, "cyan"},
{NamedColors::MAGENTA, "magenta"},
{NamedColors::PINK, "pink"},
{NamedColors::GRAY, "gray"},
});
enum_field(config.color, "color");
field(config.use_color, "use_color");
field(config.draw_interlayer, "draw_interlayer");
field(config.interlayer_use_source, "interlayer_use_source");
Expand All @@ -108,22 +93,7 @@ void declare_config(LayerConfig::Text& config) {
field(config.scale, "scale");
field(config.add_jitter, "add_jitter");
field(config.jitter_scale, "jitter_scale");
enum_field(config.color,
"color",
{
{NamedColors::BLACK, "black"},
{NamedColors::WHITE, "white"},
{NamedColors::RED, "red"},
{NamedColors::GREEN, "green"},
{NamedColors::BLUE, "blue"},
{NamedColors::YELLOW, "yellow"},
{NamedColors::ORANGE, "orange"},
{NamedColors::PURPLE, "purple"},
{NamedColors::CYAN, "cyan"},
{NamedColors::MAGENTA, "magenta"},
{NamedColors::PINK, "pink"},
{NamedColors::GRAY, "gray"},
});
enum_field(config.color, "color");
}

void declare_config(LayerConfig::BoundingBoxes& config) {
Expand Down