MCPcopy Create free account
hub / github.com/antvis/F2Native / ParseRGBAFullString

Function ParseRGBAFullString

core/graphics/canvas/CanvasColorParser.cpp:194–202  ·  view source on GitHub ↗

rgba

Source from the content-addressed store, hash-verified

192
193// rgba
194void ParseRGBAFullString(char value[8], CanvasColor &output) {
195 unsigned long hex = 0x00000000 | strtoul(value, nullptr, 16);
196 // output.rgba = {(hex >> 24) / 255.0f, ((hex & 0xff0000) >> 16) / 255.0f,
197 // ((hex & 0xff00) >> 8) / 255.0f, (hex & 0xff) / 255.0f};
198 output.r = hex >> 24;
199 output.g = ((hex & 0xff0000) >> 16);
200 output.b = ((hex & 0xff00) >> 8);
201 output.a = (hex & 0xff);
202}
203
204bool HandleBraceRGBAColor(char *value, InnerColorRGBA &output) {
205 int length = (int) strlen(value);

Callers 1

ParseMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected