diff options
| author | Tim Redfern <tim@getdrop.com> | 2023-04-23 23:56:13 +0100 |
|---|---|---|
| committer | Tim Redfern <tim@getdrop.com> | 2023-04-23 23:56:13 +0100 |
| commit | 18465815cd28b034ee4a755904a4d8084b00b4e9 (patch) | |
| tree | 0661eec450277021c0a66fb04a6aace638485134 /nextus/src/vectorText.h | |
| parent | 9e0236016f5d6afd3a73edad183dfb2b02387e98 (diff) | |
actually use palettes
Diffstat (limited to 'nextus/src/vectorText.h')
| -rw-r--r-- | nextus/src/vectorText.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/nextus/src/vectorText.h b/nextus/src/vectorText.h index 4fb7520..91ff3c7 100644 --- a/nextus/src/vectorText.h +++ b/nextus/src/vectorText.h @@ -169,8 +169,8 @@ public: void loadPalette(string path){ ofxXmlSettings xml; if (xml.load(path)){ - ofLog()<<path<<": found palette, "<<xml.getNumTags("colour")<<" colours"; vector<ofColor> palette; + ofLog()<<"loading palette "<<path<<" with "<<xml.getNumTags("colour")<<" colour tags"; for (int i=0;i<xml.getNumTags("colour");i++){ string s=xml.getValue("colour","", i); try { @@ -181,7 +181,10 @@ public: ofLog()<<"palette loader: could not convert "<<s; } } - if (palette.size()) loadPalette(palette); + if (palette.size()) { + ofLog()<<"colours found: "<<palette.size(); + loadPalette(palette); + } } else { ofLog()<<"could not load palette "<<path; @@ -265,7 +268,7 @@ public: } } void clear(){words.clear();} - void update(float speed=1.0f,bool usePalette=false,bool use_beat=false,int onset_frame=0){ + void update(float speed=1.0f,bool use_beat=false,int onset_frame=0){ if (!words.size()) return; @@ -308,7 +311,7 @@ public: for (auto& g:words[i].glyphs){ if (ofRandom(100)<speed) { g.colour= - usePalette? + palette.size()? palette[ofRandom(palette.size())]: ofColor::fromHsb(ofRandom(119)+112,ofRandom(255),255); } |
