FastLED 3.10.6
Loading...
Searching...
No Matches

◆ serializeVideoColor()

fl::string fl::fled::anonymous_namespace{builder.cpp.hpp}::serializeVideoColor ( const VideoColor & c)

Definition at line 100 of file builder.cpp.hpp.

100 {
101 fl::string out;
102 out += "{\"primaries\":";
103 const char* named = primariesName(c.primaries);
104 if (named != nullptr) {
105 out += '"';
106 out += named;
107 out += '"';
108 } else {
109 out += "{\"red\":";
111 out += ",\"green\":";
113 out += ",\"blue\":";
115 out += ",\"white\":";
117 out += '}';
118 }
119 out += ",\"transfer\":\"";
120 out += transferName(c.transfer);
121 // v1 defines exactly one value for each of matrix and range; the parser
122 // rejects anything else, so emitting them literally keeps producer and
123 // parser from drifting apart.
124 out += "\",\"matrix\":\"rgb\",\"range\":\"full\"}";
125 return out;
126}
const char * primariesName(ColorPrimaries p) FL_NO_EXCEPT
void appendXy(fl::string &out, float x, float y) FL_NO_EXCEPT
const char * transferName(ColorTransfer t) FL_NO_EXCEPT
ColorPrimaries primaries
Definition color.h:85
ColorTransfer transfer
Definition color.h:86
float customPrimaries[8]
Definition color.h:92

References appendXy(), fl::FL_NO_EXCEPT, primariesName(), serializeVideoColor(), and transferName().

Referenced by serializeVideoColor().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: