MCPcopy Create free account
hub / github.com/BespokeSynth/BespokeSynth / ofSetColor

Function ofSetColor

Source/OpenFrameworksPort.cpp:213–230  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

211}
212
213void 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
232void ofSetColorGradient(const ofColor& colorA, const ofColor& colorB, ofVec2f gradientStart, ofVec2f gradientEnd)
233{

Callers 15

RenderMethod · 0.85
DrawModuleMethod · 0.85
DrawModuleMethod · 0.85
DrawModuleMethod · 0.85
DrawModuleMethod · 0.85
DrawModuleMethod · 0.85
DrawModuleMethod · 0.85
RenderMethod · 0.85
RenderOverlayMethod · 0.85
DrawSyntaxHighlightMethod · 0.85
DrawModuleMethod · 0.85
DrawDisplayModuleRectMethod · 0.85

Calls 11

ofColorClass · 0.85
nvgStrokeColorFunction · 0.85
nvgRGBAFunction · 0.85
nvgFillColorFunction · 0.85
nvgCreateImageFunction · 0.85
ofToResourcePathFunction · 0.85
nvgImagePatternFunction · 0.85
ofRandomFunction · 0.85
nvgStrokePaintFunction · 0.85
nvgFillPaintFunction · 0.85
GetPixelRatioMethod · 0.80

Tested by 4

DrawModuleMethod · 0.68
DrawModuleMethod · 0.68
DrawModuleMethod · 0.68
DrawModuleMethod · 0.68