[chroma-js] Add mode param to valid() (#42019)

* add mode param to valid()

* test

* version update
This commit is contained in:
Greg Thompson
2020-02-05 13:47:36 -08:00
committed by GitHub
parent 28952aa6e7
commit e50a750c5a
2 changed files with 3 additions and 2 deletions
+1
View File
@@ -11,6 +11,7 @@ function test_chroma() {
chroma.valid({});
chroma.valid(null);
chroma.valid(undefined);
chroma.valid('000', 'hex');
chroma(0xff3399);
chroma(0xff, 0x33, 0x99);
+2 -2
View File
@@ -1,4 +1,4 @@
// Type definitions for Chroma.js 1.4
// Type definitions for Chroma.js 2.0
// Project: https://github.com/gka/chroma.js
// Definitions by: Sebastian Brückner <https://github.com/invliD>, Marcin Pacholec <https://github.com/mpacholec>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
@@ -62,7 +62,7 @@ declare namespace chroma {
*/
hex(color: string): Color;
valid(color: any): boolean;
valid(color: any, mode?: string): boolean;
hsl(h: number, s: number, l: number): Color;