Commit Graph

15 Commits

Author SHA1 Message Date
Nathan Shively-Sanders
64638d7018
Merge pull request #31275 from alecmolloy/master
[chroma-js] fix ColorSpaces parameters + add docs
2018-12-18 10:51:10 -08:00
alecmolloy
d1f1de4e6a [chroma-js] add ColorSpaces parameters + docs
The following code worked perfectly fine for all color functions, with the exception of `rgb` and `rgba`, which had the optional `round: boolean` parameter:

` [K in keyof ColorSpaces]: () => ColorSpaces[K];`

I've added in each function now explicitly, and put in docs to boot.
2018-12-11 23:49:16 +00:00
Alec Molloy
84da6dabad
fix semicolon 2018-12-11 23:27:25 +00:00
alecmolloy
07b487166c [chroma-js] fix valid interpolation modes
Not all `ColorSpaces` are valid for interpolation, so i created the `InterpolationMode` type, which has valid modes for interpolating between.
2018-12-11 19:48:57 +00:00
Avi Vahl
25ea685893 [chroma-js] updates types to v1.4.0 (#29150)
* [chroma-js] updates types to v1.4.0
- optional `mode` param for `Color.hex`
- `Color.num()` was officially documented, so exposed in @types as well

refs:
https://github.com/gka/chroma.js/blob/master/CHANGELOG.md
https://gka.github.io/chroma.js/#color-hex
https://gka.github.io/chroma.js/#color-num

* Remove extra empty line

* Remove extra whitespace
2018-10-01 21:41:33 -07:00
Tom Evans
abf3c77632 moving the hex scale definition into a separate overload 2018-09-27 09:13:11 +01:00
Tom Evans
a06d76a4d9 adding hex types for chromajs colour scales 2018-09-21 12:16:57 +01:00
Brian Strobach
0ef18e16fc Return type fixes for euclidean distance and color difference functions. (#28758)
Looks like these functions were accidentally typed as returning Color. Updated to return number type.
2018-09-17 01:02:01 -07:00
Niels de Bruin
dc04b32deb Added gamma method to Scale type 2018-05-25 01:43:47 +02:00
Adrian Leonhard
9760b4ae79 [chroma-js] fix bug with Scale.colors. 2018-03-01 10:58:51 +01:00
Andy
097d2acf71 Miscellaneous lint fixes (#20849) 2017-10-22 15:22:50 -07:00
Windson Yan
b60783a6ef Fix the parameter list of blend method, accept dodge instead of dogde (#20129) 2017-10-04 22:47:14 +09:00
Adrian Leonhard
15272b994a [chroma-js] Renamed namespace so types visible.
Renamed namespace Chroma which contains all the types to chroma so it is merged with the exported variable chroma and the types are externally visible. Added corresponding test.
2017-08-15 13:47:18 +02:00
Adrian Leonhard
a6c6caa940 Multiple fixes to types/chroma-js/index.d.ts (#16769)
* Multiple fixes to types/chroma-js/index.d.ts
* Fixed bezier method
* typed string parameters to be string unions
* added out parameter to Scale.colors
* changed color types to number tuples instead of arrays
* added types/chroma-js/tslint.json

* [chroma-js] Added documentation
Copied method descriptions from the API docs.

* [chroma-js] Added more documentation
Copied method descriptions from the API docs.

* Actually ran the linter...

* [chroma-js] reverted package.json
2017-06-02 12:42:09 -07:00
Andy Hanson
354cec620d Move all packages to a types directory 2017-03-24 14:27:52 -07:00