| 211 | } |
| 212 | |
| 213 | void ofSetColor(float r, float g, float b, float a) |
| 214 | { |
| 215 | sStyleStack.GetStyle().color = ofColor(r, g, b, a); |
| 216 | if (Push2Control::sDrawingPush2Display) |
| 217 | { |
| 218 | nvgStrokeColor(gNanoVG, nvgRGBA(r, g, b, a)); |
| 219 | nvgFillColor(gNanoVG, nvgRGBA(r, g, b, a)); |
| 220 | return; |
| 221 | } |
| 222 | static int sImage = -1; |
| 223 | if (sImage == -1) |
| 224 | sImage = nvgCreateImage(gNanoVG, ofToResourcePath("noise.jpg").c_str(), NVG_IMAGE_REPEATX | NVG_IMAGE_REPEATY); |
| 225 | NVGpaint pattern = nvgImagePattern(gNanoVG, ofRandom(0, 10), ofRandom(0, 10), 300 / gDrawScale / TheSynth->GetPixelRatio(), 300 / gDrawScale / TheSynth->GetPixelRatio(), ofRandom(0, 10), sImage, a); |
| 226 | pattern.innerColor = nvgRGBA(r, g, b, a); |
| 227 | pattern.outerColor = nvgRGBA(r, g, b, a); |
| 228 | nvgStrokePaint(gNanoVG, pattern); |
| 229 | nvgFillPaint(gNanoVG, pattern); |
| 230 | } |
| 231 | |
| 232 | void ofSetColorGradient(const ofColor& colorA, const ofColor& colorB, ofVec2f gradientStart, ofVec2f gradientEnd) |
| 233 | { |