diff -Nru node-color-2.0.0/debian/changelog node-color-3.1.2/debian/changelog --- node-color-2.0.0/debian/changelog 2017-10-28 07:50:55.000000000 +0000 +++ node-color-3.1.2/debian/changelog 2019-12-17 01:51:15.000000000 +0000 @@ -1,3 +1,19 @@ +node-color (3.1.2-1) unstable; urgency=medium + + * Team upload + * Bump debhelper compatibility level to 12 + * Declare compliance with policy 4.4.1 + * Add "Rules-Requires-Root: no" + * Add debian/gbp.conf + * Add upstream/metadata + * Drop unneeded version constraints from (build) dependencies + * Update VCS fields to salsa + * Fix d/copyright format url + * New upstream version 3.1.2 + * Switch test and install to pkg-js-tools + + -- Xavier Guimard Tue, 17 Dec 2019 02:51:15 +0100 + node-color (2.0.0-1) unstable; urgency=low * Initial release (Closes: #879997) diff -Nru node-color-2.0.0/debian/compat node-color-3.1.2/debian/compat --- node-color-2.0.0/debian/compat 2017-10-28 07:23:32.000000000 +0000 +++ node-color-3.1.2/debian/compat 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -9 diff -Nru node-color-2.0.0/debian/control node-color-3.1.2/debian/control --- node-color-2.0.0/debian/control 2017-10-28 07:50:55.000000000 +0000 +++ node-color-3.1.2/debian/control 2019-12-17 01:49:06.000000000 +0000 @@ -1,27 +1,28 @@ Source: node-color -Section: javascript -Priority: optional Maintainer: Debian Javascript Maintainers Uploaders: Pirate Praveen +Section: javascript +Testsuite: autopkgtest-pkg-nodejs +Priority: optional Build-Depends: - debhelper (>= 9) - , dh-buildinfo - , nodejs - , mocha - , node-color-string (>= 1.4.0) - , node-color-convert (>= 1.8.2) -Standards-Version: 4.1.1 + debhelper-compat (= 12) + , mocha + , node-color-string + , node-color-convert + , pkg-js-tools (>= 0.9.20~) +Standards-Version: 4.4.1 +Vcs-Browser: https://salsa.debian.org/js-team/node-color +Vcs-Git: https://salsa.debian.org/js-team/node-color.git Homepage: https://github.com/Qix-/color#readme -Vcs-Git: https://anonscm.debian.org/git/pkg-javascript/node-color.git -Vcs-Browser: https://anonscm.debian.org/cgit/pkg-javascript/node-color.git +Rules-Requires-Root: no Package: node-color Architecture: all Depends: ${misc:Depends} , nodejs - , node-color-string (>= 1.4.0) - , node-color-convert (>= 1.8.2) + , node-color-string + , node-color-convert Description: Color conversion and manipulation with CSS string support JavaScript library for immutable color conversion and manipulation with support for CSS color strings. diff -Nru node-color-2.0.0/debian/copyright node-color-3.1.2/debian/copyright --- node-color-2.0.0/debian/copyright 2017-10-28 07:50:55.000000000 +0000 +++ node-color-3.1.2/debian/copyright 2019-12-17 01:43:04.000000000 +0000 @@ -1,4 +1,4 @@ -Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: color Upstream-Contact: https://github.com/Qix-/color/issues Source: https://github.com/Qix-/color#readme diff -Nru node-color-2.0.0/debian/gbp.conf node-color-3.1.2/debian/gbp.conf --- node-color-2.0.0/debian/gbp.conf 1970-01-01 00:00:00.000000000 +0000 +++ node-color-3.1.2/debian/gbp.conf 2019-12-17 01:42:53.000000000 +0000 @@ -0,0 +1,5 @@ +[DEFAULT] +pristine-tar = True + +[import-orig] +filter = [ '.gitignore', '.travis.yml', '.git*' ] diff -Nru node-color-2.0.0/debian/install node-color-3.1.2/debian/install --- node-color-2.0.0/debian/install 2017-10-28 07:23:32.000000000 +0000 +++ node-color-3.1.2/debian/install 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -index.js usr/lib/nodejs/color/ -package.json usr/lib/nodejs/color/ diff -Nru node-color-2.0.0/debian/rules node-color-3.1.2/debian/rules --- node-color-2.0.0/debian/rules 2017-10-28 07:50:55.000000000 +0000 +++ node-color-3.1.2/debian/rules 2019-12-17 01:49:08.000000000 +0000 @@ -5,9 +5,4 @@ #export DH_VERBOSE=1 %: - dh $@ - -#override_dh_auto_build: - -override_dh_auto_test: - mocha -R spec + dh $@ --with nodejs diff -Nru node-color-2.0.0/debian/tests/control node-color-3.1.2/debian/tests/control --- node-color-2.0.0/debian/tests/control 2017-10-28 07:50:55.000000000 +0000 +++ node-color-3.1.2/debian/tests/control 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -Tests: require -Depends: node-color - -Test-Command: mocha -R spec -Depends: @, mocha diff -Nru node-color-2.0.0/debian/tests/pkg-js/test node-color-3.1.2/debian/tests/pkg-js/test --- node-color-2.0.0/debian/tests/pkg-js/test 1970-01-01 00:00:00.000000000 +0000 +++ node-color-3.1.2/debian/tests/pkg-js/test 2019-12-17 01:49:54.000000000 +0000 @@ -0,0 +1 @@ +mocha diff -Nru node-color-2.0.0/debian/tests/require node-color-3.1.2/debian/tests/require --- node-color-2.0.0/debian/tests/require 2017-10-28 07:23:32.000000000 +0000 +++ node-color-3.1.2/debian/tests/require 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -#!/bin/sh -set -e -nodejs -e "require('color');" diff -Nru node-color-2.0.0/debian/upstream/metadata node-color-3.1.2/debian/upstream/metadata --- node-color-2.0.0/debian/upstream/metadata 1970-01-01 00:00:00.000000000 +0000 +++ node-color-3.1.2/debian/upstream/metadata 2019-12-17 01:42:53.000000000 +0000 @@ -0,0 +1,5 @@ +--- +Archive: GitHub +Bug-Database: https://github.com/Qix-/color/issues +Repository: https://github.com/Qix-/color.git +Repository-Browse: https://github.com/Qix-/color diff -Nru node-color-2.0.0/index.js node-color-3.1.2/index.js --- node-color-2.0.0/index.js 2017-06-29 07:07:52.000000000 +0000 +++ node-color-3.1.2/index.js 2019-06-03 10:17:51.000000000 +0000 @@ -39,7 +39,7 @@ var i; var channels; - if (!obj) { + if (obj == null) { // eslint-disable-line no-eq-null,eqeqeq this.model = 'rgb'; this.color = [0, 0, 0]; this.valpha = 1; @@ -284,15 +284,15 @@ return (contrastRatio >= 4.5) ? 'AA' : ''; }, - dark: function () { + isDark: function () { // YIQ equation from http://24ways.org/2010/calculating-color-contrast var rgb = this.rgb().color; var yiq = (rgb[0] * 299 + rgb[1] * 587 + rgb[2] * 114) / 1000; return yiq < 128; }, - light: function () { - return !this.dark(); + isLight: function () { + return !this.isDark(); }, negate: function () { @@ -366,6 +366,9 @@ mix: function (mixinColor, weight) { // ported from sass implementation in C // https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209 + if (!mixinColor || !mixinColor.rgb) { + throw new Error('Argument to "mix" was not a Color instance, but rather an instance of ' + typeof mixinColor); + } var color1 = mixinColor.rgb(); var color2 = this.rgb(); var p = weight === undefined ? 0.5 : weight; diff -Nru node-color-2.0.0/package.json node-color-3.1.2/package.json --- node-color-2.0.0/package.json 2017-06-29 07:07:52.000000000 +0000 +++ node-color-3.1.2/package.json 2019-06-03 10:17:51.000000000 +0000 @@ -1,6 +1,6 @@ { "name": "color", - "version": "2.0.0", + "version": "3.1.2", "description": "Color conversion and manipulation with CSS string support", "keywords": [ "color", @@ -30,11 +30,11 @@ "test": "mocha" }, "dependencies": { - "color-convert": "^1.8.2", - "color-string": "^1.4.0" + "color-convert": "^1.9.1", + "color-string": "^1.5.2" }, "devDependencies": { - "mocha": "^2.2.5", - "xo": "^0.12.1" + "mocha": "^6.1.4", + "xo": "0.12.1" } } diff -Nru node-color-2.0.0/README.md node-color-3.1.2/README.md --- node-color-2.0.0/README.md 2017-06-29 07:07:52.000000000 +0000 +++ node-color-3.1.2/README.md 2019-06-03 10:17:51.000000000 +0000 @@ -29,7 +29,9 @@ var color = Color.rgb([255, 255, 255]) ``` -Set the values for individual channels with `alpha`, `red`, `green`, `blue`, `hue`, `saturation` (hsl), `saturationv` (hsv), `lightness`, `whiteness`, `blackness`, `cyan`, `magenta`, `yellow`, `black` +Set the values for individual channels with `alpha`, `red`, `green`, `blue`, `hue`, `saturationl` (hsl), `saturationv` (hsv), `lightness`, `whiteness`, `blackness`, `cyan`, `magenta`, `yellow`, `black` + +String constructors are handled by [color-string](https://www.npmjs.com/package/color-string) ### Getters ```js @@ -53,6 +55,11 @@ Get the rgb number value. ```js +color.hex() // 0xffffff +``` +Get the hex value. + +```js color.red() // 255 ``` Get the value for an individual channel. @@ -76,8 +83,8 @@ The [WCAG contrast ratio](http://www.w3.org/TR/WCAG20/#contrast-ratiodef) to another color, from 1 (same color) to 21 (contrast b/w white and black). ```js -color.light(); // true -color.dark(); // false +color.isLight(); // true +color.isDark(); // false ``` Get whether the color is "light" or "dark", useful for deciding text color. diff -Nru node-color-2.0.0/test/index.js node-color-3.1.2/test/index.js --- node-color-2.0.0/test/index.js 2017-06-29 07:07:52.000000000 +0000 +++ node-color-3.1.2/test/index.js 2019-06-03 10:17:51.000000000 +0000 @@ -16,6 +16,14 @@ notStrictEqual(c.rgb(), c.rgb()); }); +it('Color() instance (null)', function () { + ok((new Color(null)) instanceof Color); +}); + +it('Color() instance (undefined)', function () { + ok((new Color(undefined)) instanceof Color); +}); + it('Immutability', function () { var c = Color(0xFF0000); ok(c !== c.rgb()); @@ -533,15 +541,15 @@ equal(Math.round(Color('white').contrast(Color('red'))), 4); equal(Math.round(Color('red').contrast(Color('white'))), 4); equal(Color('blue').contrast(Color('blue')), 1); - ok(Color('black').dark()); - ok(!Color('black').light()); - ok(Color('white').light()); - ok(!Color('white').dark()); - ok(Color('blue').dark()); - ok(Color('darkgreen').dark()); - ok(Color('pink').light()); - ok(Color('goldenrod').light()); - ok(Color('red').dark()); + ok(Color('black').isDark()); + ok(!Color('black').isLight()); + ok(Color('white').isLight()); + ok(!Color('white').isDark()); + ok(Color('blue').isDark()); + ok(Color('darkgreen').isDark()); + ok(Color('pink').isLight()); + ok(Color('goldenrod').isLight()); + ok(Color('red').isDark()); }); it('Manipulators wo/ mix', function () { @@ -662,4 +670,8 @@ throws(function () { Color({}); }, /Unable to parse color from object/); + + throws(function () { + Color(''); + }, /Unable to parse color from string/); }); diff -Nru node-color-2.0.0/.travis.yml node-color-3.1.2/.travis.yml --- node-color-2.0.0/.travis.yml 2017-06-29 07:07:52.000000000 +0000 +++ node-color-3.1.2/.travis.yml 2019-06-03 10:17:51.000000000 +0000 @@ -3,3 +3,6 @@ node_js: - 0.12 - 4 + - 6 + - 8 + - latest