From 300d30753459bbd6fe6b53b61e44e21e3669fc97 Mon Sep 17 00:00:00 2001 From: feitzi Date: Fri, 16 Sep 2016 12:58:59 +0200 Subject: [PATCH] added test for randomColor --- randomColor/randomColor-tests.ts | 38 ++++++++++++++++++++++++++++++++ randomColor/randomColor.d.ts | 2 +- 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/randomColor/randomColor-tests.ts b/randomColor/randomColor-tests.ts index 274768ebc1..69b617615e 100644 --- a/randomColor/randomColor-tests.ts +++ b/randomColor/randomColor-tests.ts @@ -1,2 +1,40 @@ /// +// Returns a hex code for an attractive color +randomColor(); + +// Returns an array of ten green colors +randomColor({ + count: 10, + hue: 'green' +}); + +// Returns a hex code for a light blue +randomColor({ + luminosity: 'light', + hue: 'blue' +}); + +// Returns a hex code for a 'truly random' color +randomColor({ + luminosity: 'random', + hue: 'random' +}); + +// Returns a bright color in RGB +randomColor({ + luminosity: 'bright', + format: 'rgb' // e.g. 'rgb(225,200,20)' +}); + +// Returns a dark RGB color with random alpha +randomColor({ + luminosity: 'dark', + format: 'rgba' // e.g. 'rgba(9, 1, 107, 0.6482447960879654)' +}); + +// Returns a light HSL color with random alpha +randomColor({ + luminosity: 'light', + format: 'hsla' // e.g. 'hsla(27, 88.99%, 81.83%, 0.6450211517512798)' +}); \ No newline at end of file diff --git a/randomColor/randomColor.d.ts b/randomColor/randomColor.d.ts index e439e2d77d..81f43a0228 100644 --- a/randomColor/randomColor.d.ts +++ b/randomColor/randomColor.d.ts @@ -16,7 +16,7 @@ declare namespace RandomColor { interface randomColorOptions { hue? : string; luminosity? : string; - count? : string; + count? : string | number; seed?: string; format?: string; }