MCPcopy Create free account
hub / github.com/benfry/processing4 / style

Method style

core/src/processing/core/PGraphics.java:6297–6373  ·  view source on GitHub ↗
(PStyle s)

Source from the content-addressed store, hash-verified

6295
6296
6297 public void style(PStyle s) {
6298 // if (s.smooth) {
6299 // smooth();
6300 // } else {
6301 // noSmooth();
6302 // }
6303
6304 imageMode(s.imageMode);
6305 rectMode(s.rectMode);
6306 ellipseMode(s.ellipseMode);
6307 shapeMode(s.shapeMode);
6308
6309 if (blendMode != s.blendMode) {
6310 blendMode(s.blendMode);
6311 }
6312
6313 if (s.tint) {
6314 tint(s.tintColor);
6315 } else {
6316 noTint();
6317 }
6318 if (s.fill) {
6319 fill(s.fillColor);
6320 } else {
6321 noFill();
6322 }
6323 if (s.stroke) {
6324 stroke(s.strokeColor);
6325 } else {
6326 noStroke();
6327 }
6328 strokeWeight(s.strokeWeight);
6329 strokeCap(s.strokeCap);
6330 strokeJoin(s.strokeJoin);
6331
6332 // Set the colorMode() for the material properties.
6333 // TODO this is really inefficient, need to just have a material() method,
6334 // but this has the least impact to the API.
6335 colorMode(RGB, 1);
6336 ambient(s.ambientR, s.ambientG, s.ambientB);
6337 emissive(s.emissiveR, s.emissiveG, s.emissiveB);
6338 specular(s.specularR, s.specularG, s.specularB);
6339 shininess(s.shininess);
6340
6341 /*
6342 s.ambientR = ambientR;
6343 s.ambientG = ambientG;
6344 s.ambientB = ambientB;
6345 s.specularR = specularR;
6346 s.specularG = specularG;
6347 s.specularB = specularB;
6348 s.emissiveR = emissiveR;
6349 s.emissiveG = emissiveG;
6350 s.emissiveB = emissiveB;
6351 s.shininess = shininess;
6352 */
6353 // material(s.ambientR, s.ambientG, s.ambientB,
6354 // s.emissiveR, s.emissiveG, s.emissiveB,

Callers 1

popStyleMethod · 0.95

Calls 15

imageModeMethod · 0.95
rectModeMethod · 0.95
ellipseModeMethod · 0.95
shapeModeMethod · 0.95
blendModeMethod · 0.95
tintMethod · 0.95
noTintMethod · 0.95
fillMethod · 0.95
noFillMethod · 0.95
strokeMethod · 0.95
noStrokeMethod · 0.95
strokeWeightMethod · 0.95

Tested by

no test coverage detected