Skip to content
This repository has been archived by the owner on Sep 2, 2022. It is now read-only.

Commit

Permalink
Do not return transparent if color is originally defined as rgba vaad…
Browse files Browse the repository at this point in the history
…in#319

* map only transparent eagerly to transparent
  • Loading branch information
mkgl committed Aug 28, 2018
1 parent df29131 commit e7137db
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -990,19 +990,18 @@ public String buildString(BuildStringStrategy strategy) {
case LexicalUnit.SAC_COUNTERS_FUNCTION:
case LexicalUnit.SAC_RECT_FUNCTION:
case LexicalUnit.SAC_FUNCTION:
if (ColorUtil.isColor(this)) {
if (ColorUtil.isTransparent(this)) {
text = "transparent";
break;
} else if (ColorUtil.isColor(this)) {
text = ColorUtil.rgbToColorString(ColorUtil
.colorToRgb(this));
break;
} else if (ColorUtil.isRgba(this) || ColorUtil.isHsla(this)) {
float alpha = params.get(params.size() - 1)
.getContainedValue().getFloatValue();
rgb = ColorUtil.colorToRgb(this);
if (alpha == 0.0f && rgb[0] == 0 && rgb[1] == 0
&& rgb[2] == 0) {
text = "transparent";
break;
} else if (alpha == 1.0f) {
if (alpha == 1.0f) {
text = ColorUtil.rgbToColorString(ColorUtil
.colorToRgb(this));
break;
Expand Down

0 comments on commit e7137db

Please sign in to comment.