nano-color
Advanced tools
Comparing version 1.0.0 to 1.0.1
35
index.js
@@ -285,2 +285,20 @@ "use strict"; | ||
function color(x) { | ||
return [ | ||
line[0][0]*ix + line[0][1] +.5 | 0, | ||
line[1][0]*ix + line[1][1] +.5 | 0, | ||
line[2][0]*ix + line[2][1] +.5 | 0, | ||
line[3][0]*ix + line[3][1] +.5 | 0 | ||
]; | ||
} | ||
function mix(f, c1, c2) { | ||
var nf = 1.-f; | ||
return [ | ||
c1[0]*f + c2[0]*nf +.5 | 0, | ||
c1[1]*f + c2[1]*nf +.5 | 0, | ||
c1[2]*f + c2[2]*nf +.5 | 0, | ||
c1[3]*f + c2[3]*nf +.5 | 0 | ||
]; | ||
}; | ||
var w = pos_b - pos_a, i = 0, x1, c1, x2, c2, c = [], line = []; | ||
@@ -297,19 +315,2 @@ for (var p in gr) { | ||
function color(x) { | ||
return [ | ||
line[0][0]*ix + line[0][1] +.5 | 0, | ||
line[1][0]*ix + line[1][1] +.5 | 0, | ||
line[2][0]*ix + line[2][1] +.5 | 0, | ||
line[3][0]*ix + line[3][1] +.5 | 0 | ||
]; | ||
} | ||
function mix(f, c1, c2) { | ||
var nf = 1.-f; | ||
return [ | ||
c1[0]*f + c2[0]*nf +.5 | 0, | ||
c1[1]*f + c2[1]*nf +.5 | 0, | ||
c1[2]*f + c2[2]*nf +.5 | 0, | ||
c1[3]*f + c2[3]*nf +.5 | 0 | ||
]; | ||
}; | ||
for (var ix = (x1+.9999)|0, ie = x2|0; ix < ie; ++ix) | ||
@@ -316,0 +317,0 @@ callback.call(this, ix, color(ix)); |
{ | ||
"name": "nano-color", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "", | ||
"keywords" : [ "HSV", "RGB", "RGBA", "hsv-filter", "coloring-filter", "gradient" ], | ||
"main": "index.js", | ||
@@ -14,2 +15,3 @@ "scripts": { | ||
"devDependencies": { | ||
"core-assert": "0", | ||
"mocha": "2", | ||
@@ -16,0 +18,0 @@ "colors": "0", |
var c = require('../index.js'), | ||
assert = require('assert'); | ||
assert = require('core-assert'); | ||
@@ -4,0 +4,0 @@ var timer = function (ms, v) { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
25438
4