MCPcopy Create free account
hub / github.com/MITK/MITK / LabelColorSwatch

Function LabelColorSwatch

Wrapping/Python/mitk/MultiLabelSegmentation.cpp:343–352  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

341}
342
343std::string LabelColorSwatch(const Label& l)
344{
345 const auto& c = l.GetColor();
346 std::ostringstream os;
347 os << "<span style=\"display:inline-block;width:12px;height:12px;background:rgb("
348 << static_cast<int>(c.GetRed() * 255) << ','
349 << static_cast<int>(c.GetGreen() * 255) << ','
350 << static_cast<int>(c.GetBlue() * 255) << ")\"></span>";
351 return os.str();
352}
353
354// Renders one label as a table row. Rows nested under a group header are
355// indented; a standalone Label table renders flush.

Callers 1

LabelRowHtmlFunction · 0.85

Calls 1

GetColorMethod · 0.45

Tested by

no test coverage detected