MCPcopy Create free account
hub / github.com/FreeCAD/FreeCAD / asHexString

Method asHexString

src/Base/Color.cpp:129–139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

127}
128
129std::string Color::asHexString() const
130{
131 // clang-format off
132 std::stringstream ss;
133 ss << "#" << std::hex << std::uppercase << std::setfill('0')
134 << std::setw(2) << int(std::lround(r * 255.0F))
135 << std::setw(2) << int(std::lround(g * 255.0F))
136 << std::setw(2) << int(std::lround(b * 255.0F));
137 return ss.str();
138 // clang-format on
139}
140
141bool Color::fromHexString(const std::string& hex)
142{

Callers 11

toStringMethod · 0.80
SaveMethod · 0.80
toStringMethod · 0.80
SaveMethod · 0.80
SaveMethod · 0.80
executeMethod · 0.80
getSheetImageMethod · 0.80
setHatchColorMethod · 0.80
drawAnnotationMethod · 0.80
createMethod · 0.80
TESTFunction · 0.80

Calls 1

strMethod · 0.45

Tested by

no test coverage detected