Skip to content

Commit

Permalink
Fixed darken color for case when point color is different than line c…
Browse files Browse the repository at this point in the history
…olor
  • Loading branch information
lecho committed Jul 2, 2015
1 parent 11230a0 commit 7d38a9f
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions hellocharts-library/src/lecho/lib/hellocharts/model/Line.java
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,14 @@ public int getColor() {

public Line setColor(int color) {
this.color = color;
this.darkenColor = ChartUtils.darkenColor(color);
if (pointColor == UNINITIALIZED) {
this.darkenColor = ChartUtils.darkenColor(color);
}
return this;
}

public int getPointColor() {
if(pointColor == UNINITIALIZED){
if (pointColor == UNINITIALIZED) {
return color;
} else {
return pointColor;
Expand All @@ -114,6 +116,11 @@ public int getPointColor() {

public Line setPointColor(int pointColor) {
this.pointColor = pointColor;
if (pointColor == UNINITIALIZED) {
this.darkenColor = ChartUtils.darkenColor(color);
} else {
this.darkenColor = ChartUtils.darkenColor(pointColor);
}
return this;
}

Expand Down Expand Up @@ -218,7 +225,7 @@ public boolean isCubic() {

public Line setCubic(boolean isCubic) {
this.isCubic = isCubic;
if(isSquare)
if (isSquare)
setSquare(false);
return this;
}
Expand All @@ -229,7 +236,7 @@ public boolean isSquare() {

public Line setSquare(boolean isSquare) {
this.isSquare = isSquare;
if(isCubic)
if (isCubic)
setCubic(false);
return this;
}
Expand Down

0 comments on commit 7d38a9f

Please sign in to comment.