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

Function ofSetColorGradient

Source/OpenFrameworksPort.cpp:232–244  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

230}
231
232void ofSetColorGradient(const ofColor& colorA, const ofColor& colorB, ofVec2f gradientStart, ofVec2f gradientEnd)
233{
234 sStyleStack.GetStyle().color = colorA;
235 if (Push2Control::sDrawingPush2Display)
236 {
237 nvgStrokeColor(gNanoVG, nvgRGBA(colorA.r, colorA.g, colorA.b, colorA.a));
238 nvgFillColor(gNanoVG, nvgRGBA(colorA.r, colorA.g, colorA.b, colorA.a));
239 return;
240 }
241 NVGpaint pattern = nvgLinearGradient(gNanoVG, gradientStart.x, gradientStart.y, gradientEnd.x, gradientEnd.y, nvgRGBA(colorA.r, colorA.g, colorA.b, colorA.a), nvgRGBA(colorB.r, colorB.g, colorB.b, colorB.a));
242 nvgStrokePaint(gNanoVG, pattern);
243 nvgFillPaint(gNanoVG, pattern);
244}
245
246void ofSetColor(float grey)
247{

Callers 3

DrawContentsMethod · 0.85
RenderMethod · 0.85
RenderMethod · 0.85

Calls 6

nvgStrokeColorFunction · 0.85
nvgRGBAFunction · 0.85
nvgFillColorFunction · 0.85
nvgLinearGradientFunction · 0.85
nvgStrokePaintFunction · 0.85
nvgFillPaintFunction · 0.85

Tested by

no test coverage detected