diff options
author | David Runge <dave@sleepmap.de> | 2016-01-02 19:11:59 +0100 |
---|---|---|
committer | David Runge <dave@sleepmap.de> | 2016-01-02 19:11:59 +0100 |
commit | 7c668a004375978213fa843bd78d26d48e0ed5b1 (patch) | |
tree | 9fa96252e42118bd60950b09e577b70634e78aaa | |
parent | d8aa68606dd8596309d3f3c1a69c3c84b0471bf5 (diff) | |
download | processing-sketchbook-7c668a004375978213fa843bd78d26d48e0ed5b1.tar.gz processing-sketchbook-7c668a004375978213fa843bd78d26d48e0ed5b1.tar.bz2 processing-sketchbook-7c668a004375978213fa843bd78d26d48e0ed5b1.tar.xz processing-sketchbook-7c668a004375978213fa843bd78d26d48e0ed5b1.zip |
AutoVisual/IGPFamily.pde: Adding functions for setting stroke and fill
colors. Updating createDiagonalConstructionLinesOnAlphaCircle() to use
alphaCircleVectorsSixteen ArrayList.
-rw-r--r-- | AutoVisual/IGPFamily.pde | 35 |
1 files changed, 32 insertions, 3 deletions
diff --git a/AutoVisual/IGPFamily.pde b/AutoVisual/IGPFamily.pde index 9ee62cc..ff8d480 100644 --- a/AutoVisual/IGPFamily.pde +++ b/AutoVisual/IGPFamily.pde @@ -2,6 +2,10 @@ class IGPFamily { PVector mid; float diameter; float radius; + Float[] defaultFillColor = {0.0, 0.0, 0.0, 0.0}; + Float[] defaultStrokeColor = {0.66, 0.66, 0.66, 0.4}; + Float[] fillColor; + Float[] strokeColor; ArrayList <PVector> alphaCircleVectors; ArrayList <PVector> alphaCircleVectorsSixteen; ArrayList <PVector> constructionCircleCenters; @@ -50,6 +54,32 @@ class IGPFamily { alphaCircleVectorsSixteen.add(getVectorOnAlphaCircle(337.5)); } + void setFillColor(Float[] fillColor){ + if (fillColor.length==4){ + this.fillColor = fillColor; + } + } + + void setStrokeColor(Float[] strokeColor){ + if (strokeColor.length==4){ + this.strokeColor = strokeColor; + } + } + + void useStrokeColor(){ + if(strokeColor.length!=4 || strokeColor == null){ + strokeColor = defaultStrokeColor; + } + stroke(strokeColor[0], strokeColor[1], strokeColor[2], strokeColor[3]); + } + + void useFillColor(){ + if(fillColor.length!=4 || fillColor == null){ + fillColor = defaultFillColor; + } + fill(fillColor[0], fillColor[1], fillColor[2], fillColor[3]); + } + PVector getVectorOnCircle(PVector mid, float degree){ PVector point = new PVector(mid.x + radius*cos(radians(degree)), mid.y + radius * sin(radians(degree))); return point; @@ -121,9 +151,8 @@ class IGPFamily { } void createDiagonalConstructionLinesOnAlphaCircle(){ - //TODO: use PVectors from ArrayList - createLine(getVectorOnAlphaCircle(45), getVectorOnAlphaCircle(225)); - createLine(getVectorOnAlphaCircle(135), getVectorOnAlphaCircle(315)); + createLine(alphaCircleVectorsSixteen.get(2), alphaCircleVectorsSixteen.get(10)); + createLine(alphaCircleVectorsSixteen.get(6), alphaCircleVectorsSixteen.get(14)); } void createInnerHexagon(){ |