Last active
February 11, 2020 08:52
-
-
Save moebiussurfing/5a76db973a82701d1c39cee0d94e78df to your computer and use it in GitHub Desktop.
openFrameworks - ofxSerializer OF types easy serialization
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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