MCPcopy Create free account
hub / github.com/Tencent/libpag / ArrayToColor

Function ArrayToColor

exporter/src/export/stream/StreamValue.cpp:172–181  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

170}
171
172static pag::Color ArrayToColor(const QJsonArray& array, const pag::Color& defaultValue) {
173 if (array.size() != 3) {
174 return defaultValue;
175 }
176 pag::Color color = {};
177 color.red = static_cast<uint8_t>(array[0].toString().toDouble() * 255);
178 color.green = static_cast<uint8_t>(array[1].toString().toDouble() * 255);
179 color.blue = static_cast<uint8_t>(array[2].toString().toDouble() * 255);
180 return color;
181}
182
183static pag::TextDocumentHandle ParseTextDocument(const AEGP_StreamVal2&, const QVariantMap& map) {
184 bool runJavaScript = map.value("runJavaScript", false).toBool();

Callers 1

ParseTextDocumentFunction · 0.85

Calls 2

sizeMethod · 0.80
toStringMethod · 0.80

Tested by

no test coverage detected