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 | |
| parent | 9e0236016f5d6afd3a73edad183dfb2b02387e98 (diff) | |
actually use palettes
| -rw-r--r-- | nextus/src/vectorPlugin.cpp | 2 | ||||
| -rw-r--r-- | nextus/src/vectorText.h | 11 |
2 files changed, 7 insertions, 6 deletions
diff --git a/nextus/src/vectorPlugin.cpp b/nextus/src/vectorPlugin.cpp index 8a5a53d..4ffc35b 100644 --- a/nextus/src/vectorPlugin.cpp +++ b/nextus/src/vectorPlugin.cpp @@ -182,8 +182,6 @@ vector<colourPolyline> svgPanel::getLines(){ } } - //this should happen at output stage? - if (colourise){ for (auto p=output.begin();p!=output.end();p++){ p->setColour(ofColor(255,255,255)); 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); } |
