MCPcopy Create free account
hub / github.com/MyGUI/mygui / parseColour1

Method parseColour1

Tools/EditorFramework/PropertyColourControl.cpp:139–168  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

137 }
138
139 bool PropertyColourControl::parseColour1(const std::string& _value, MyGUI::Colour& _resultValue)
140 {
141 if (!_value.empty())
142 {
143 if (_value[0] == '#')
144 {
145 std::istringstream stream(_value.substr(1));
146 int result = 0;
147 stream >> std::hex >> result;
148 if (!stream.fail())
149 {
150 int item = stream.get();
151 while (item != -1)
152 {
153 if (item != ' ' && item != '\t')
154 return false;
155 item = stream.get();
156 }
157
158 _resultValue = MyGUI::Colour(
159 (unsigned char)(result >> 16) / 256.0f,
160 (unsigned char)(result >> 8) / 256.0f,
161 (unsigned char)(result) / 256.0f);
162 return true;
163 }
164 }
165 }
166
167 return false;
168 }
169
170 bool PropertyColourControl::parseColour2(const std::string& _value, MyGUI::Colour& _resultValue)
171 {

Callers

nothing calls this directly

Calls 4

substrMethod · 0.80
ColourFunction · 0.50
emptyMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected