[Pkg-javascript-commits] [less.js] 01/05: don't round values returned by colour query functions.
Jonas Smedegaard
dr at jones.dk
Mon Oct 26 23:22:52 UTC 2015
This is an automated email from the git hooks/post-receive script.
js pushed a commit to annotated tag v1.7.3
in repository less.js.
commit 91fdb3940f44d6c7e2e103a0f6baa7ea80c9036f
Author: seven-phases-max <seven.phases.max at gmail.com>
Date: Thu Jun 19 22:43:28 2014 +0400
don't round values returned by colour query functions.
---
lib/less/functions.js | 16 ++++++++--------
test/css/functions.css | 16 ++++++++--------
2 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/lib/less/functions.js b/lib/less/functions.js
index 0342591..16edc18 100644
--- a/lib/less/functions.js
+++ b/lib/less/functions.js
@@ -63,22 +63,22 @@ tree.functions = {
},
hue: function (color) {
- return new(tree.Dimension)(Math.round(color.toHSL().h));
+ return new(tree.Dimension)(color.toHSL().h);
},
saturation: function (color) {
- return new(tree.Dimension)(Math.round(color.toHSL().s * 100), '%');
+ return new(tree.Dimension)(color.toHSL().s * 100, '%');
},
lightness: function (color) {
- return new(tree.Dimension)(Math.round(color.toHSL().l * 100), '%');
+ return new(tree.Dimension)(color.toHSL().l * 100, '%');
},
hsvhue: function(color) {
- return new(tree.Dimension)(Math.round(color.toHSV().h));
+ return new(tree.Dimension)(color.toHSV().h);
},
hsvsaturation: function (color) {
- return new(tree.Dimension)(Math.round(color.toHSV().s * 100), '%');
+ return new(tree.Dimension)(color.toHSV().s * 100, '%');
},
hsvvalue: function (color) {
- return new(tree.Dimension)(Math.round(color.toHSV().v * 100), '%');
+ return new(tree.Dimension)(color.toHSV().v * 100, '%');
},
red: function (color) {
return new(tree.Dimension)(color.rgb[0]);
@@ -93,7 +93,7 @@ tree.functions = {
return new(tree.Dimension)(color.toHSL().a);
},
luma: function (color) {
- return new(tree.Dimension)(Math.round(color.luma() * color.alpha * 100), '%');
+ return new(tree.Dimension)(color.luma() * color.alpha * 100, '%');
},
luminance: function (color) {
var luminance =
@@ -101,7 +101,7 @@ tree.functions = {
+ (0.7152 * color.rgb[1] / 255)
+ (0.0722 * color.rgb[2] / 255);
- return new(tree.Dimension)(Math.round(luminance * color.alpha * 100), '%');
+ return new(tree.Dimension)(luminance * color.alpha * 100, '%');
},
saturate: function (color, amount) {
// filter: saturate(3.2);
diff --git a/test/css/functions.css b/test/css/functions.css
index ff7b0b6..e39f7ec 100644
--- a/test/css/functions.css
+++ b/test/css/functions.css
@@ -19,17 +19,17 @@
luma-white: 100%;
luma-black: 0%;
luma-black-alpha: 0%;
- luma-red: 21%;
- luma-green: 72%;
- luma-blue: 7%;
- luma-yellow: 93%;
- luma-cyan: 79%;
- luma-differs-from-luminance: 24%;
+ luma-red: 21.26%;
+ luma-green: 71.52%;
+ luma-blue: 7.22%;
+ luma-yellow: 92.78%;
+ luma-cyan: 78.74%;
+ luma-differs-from-luminance: 23.89833349%;
luminance-white: 100%;
luminance-black: 0%;
luminance-black-alpha: 0%;
- luminance-red: 21%;
- luminance-differs-from-luma: 36%;
+ luminance-red: 21.26%;
+ luminance-differs-from-luma: 36.40541176%;
contrast-filter: contrast(30%);
saturate-filter: saturate(5%);
contrast-white: #000000;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/less.js.git
More information about the Pkg-javascript-commits
mailing list