Skip to content

Instantly share code, notes, and snippets.

@moebiussurfing
Last active February 11, 2020 08:52
Show Gist options
  • Save moebiussurfing/5a76db973a82701d1c39cee0d94e78df to your computer and use it in GitHub Desktop.
Save moebiussurfing/5a76db973a82701d1c39cee0d94e78df to your computer and use it in GitHub Desktop.
openFrameworks - ofxSerializer OF types easy serialization
// Make vector.
std::vector<ofColor> palette = { ofColor::red };
// Serialize it.
ofJson json = palette;
// Save it.
ofSaveJson("palette.json", json);
// Load it.
ofJson paletteJson = ofLoadJson("palette.json");
// Deserialize.
std::vector<ofColor> newPalette = paletteJson;
// Check it.
std::cout << ofToString(newPalette) << std::endl;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment