diff --git a/lib/less/functions.js b/lib/less/functions.js index 1f63993b..3e38d5eb 100644 --- a/lib/less/functions.js +++ b/lib/less/functions.js @@ -5,7 +5,7 @@ tree.functions = { return this.rgba(r, g, b, 1.0); }, rgba: function (r, g, b, a) { - var rgb = [r, g, b].map(function (c) { return scaled(c, 256); }); + var rgb = [r, g, b].map(function (c) { return scaled(c, 255); }); a = number(a); return new(tree.Color)(rgb, a); }, diff --git a/test/css/colors.css b/test/css/colors.css index 16956772..41d1c9c1 100644 --- a/test/css/colors.css +++ b/test/css/colors.css @@ -78,3 +78,7 @@ #alpha #hsl { opacity: 1; } +#percentage { + color: 255; + border-color: rgba(255, 0, 0, 0.5); +} diff --git a/test/less/colors.less b/test/less/colors.less index 656ca636..2c6155ab 100644 --- a/test/less/colors.less +++ b/test/less/colors.less @@ -90,3 +90,8 @@ opacity: alpha(hsl(120, 100%, 50%)); } } + +#percentage { + color: red(rgb(100%, 0, 0)); + border-color: rgba(100%, 0, 0, 50%); +}