Skip to content

Commit

Permalink
Scale rgb components output by to-rgba expression
Browse files Browse the repository at this point in the history
Fixes #5777
  • Loading branch information
Anand Thakker committed Nov 30, 2017
1 parent f261eb1 commit b08ad98
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/style-spec/expression/definitions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ CompoundExpression.register(expressions, {
[ColorType],
(ctx, [v]) => {
const {r, g, b, a} = v.evaluate(ctx);
return [r, g, b, a];
return [255 * r, 255 * g, 255 * b, a];
}
],
'rgb': [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
],
"expected": {
"outputs": [
[1, 0, 0, 1],
[0.6, 0, 0.4, 1],
[0, 0, 1, 1],
[255, 0, 0, 1],
[153, 0, 102, 1],
[0, 0, 255, 1],
{"error": "Could not parse color from value 'oops blue'"}
],
"compiled": {
Expand Down

0 comments on commit b08ad98

Please sign in to comment.