index.d.ts 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929
  1. // Generated by dts-bundle-generator v9.5.1
  2. type Channels = number;
  3. type RGB = [
  4. r: number,
  5. g: number,
  6. b: number
  7. ];
  8. type HSL = [
  9. h: number,
  10. s: number,
  11. l: number
  12. ];
  13. type HSV = [
  14. h: number,
  15. s: number,
  16. v: number
  17. ];
  18. type CMYK = [
  19. c: number,
  20. m: number,
  21. y: number,
  22. k: number
  23. ];
  24. type LAB = [
  25. l: number,
  26. a: number,
  27. b: number
  28. ];
  29. type LCH = [
  30. l: number,
  31. c: number,
  32. h: number
  33. ];
  34. type HCG = [
  35. h: number,
  36. c: number,
  37. g: number
  38. ];
  39. type HWB = [
  40. h: number,
  41. w: number,
  42. b: number
  43. ];
  44. type XYZ = [
  45. x: number,
  46. y: number,
  47. z: number
  48. ];
  49. type Apple = [
  50. r16: number,
  51. g16: number,
  52. b16: number
  53. ];
  54. type Gray = [
  55. gray: number
  56. ];
  57. type ANSI16 = number;
  58. type ANSI256 = number;
  59. type Keyword = string;
  60. type HEX = string;
  61. declare namespace route {
  62. type rgb = {
  63. hsl(from: RGB): HSL;
  64. hsl(...from: RGB): HSL;
  65. hsl(from: RGB): HSL;
  66. hsl(...from: RGB): HSL;
  67. hsv(from: RGB): HSV;
  68. hsv(...from: RGB): HSV;
  69. hwb(from: RGB): HWB;
  70. hwb(...from: RGB): HWB;
  71. cmyk(from: RGB): CMYK;
  72. cmyk(...from: RGB): CMYK;
  73. xyz(from: RGB): XYZ;
  74. xyz(...from: RGB): XYZ;
  75. lab(from: RGB): LAB;
  76. lab(...from: RGB): LAB;
  77. lch(from: RGB): LCH;
  78. lch(...from: RGB): LCH;
  79. hex(from: RGB): HEX;
  80. hex(...from: RGB): HEX;
  81. keyword(from: RGB): Keyword;
  82. keyword(...from: RGB): Keyword;
  83. ansi16(from: RGB): ANSI16;
  84. ansi16(...from: RGB): ANSI16;
  85. ansi256(from: RGB): ANSI256;
  86. ansi256(...from: RGB): ANSI256;
  87. hcg(from: RGB): HCG;
  88. hcg(...from: RGB): HCG;
  89. apple(from: RGB): Apple;
  90. apple(...from: RGB): Apple;
  91. gray(from: RGB): Gray;
  92. gray(...from: RGB): Gray;
  93. };
  94. type hsl = {
  95. rgb(from: HSL): RGB;
  96. rgb(...from: HSL): RGB;
  97. hsv(from: HSL): HSV;
  98. hsv(...from: HSL): HSV;
  99. hwb(from: HSL): HWB;
  100. hwb(...from: HSL): HWB;
  101. cmyk(from: HSL): CMYK;
  102. cmyk(...from: HSL): CMYK;
  103. xyz(from: HSL): XYZ;
  104. xyz(...from: HSL): XYZ;
  105. lab(from: HSL): LAB;
  106. lab(...from: HSL): LAB;
  107. lch(from: HSL): LCH;
  108. lch(...from: HSL): LCH;
  109. hex(from: HSL): HEX;
  110. hex(...from: HSL): HEX;
  111. keyword(from: HSL): Keyword;
  112. keyword(...from: HSL): Keyword;
  113. ansi16(from: HSL): ANSI16;
  114. ansi16(...from: HSL): ANSI16;
  115. ansi256(from: HSL): ANSI256;
  116. ansi256(...from: HSL): ANSI256;
  117. hcg(from: HSL): HCG;
  118. hcg(...from: HSL): HCG;
  119. apple(from: HSL): Apple;
  120. apple(...from: HSL): Apple;
  121. gray(from: HSL): Gray;
  122. gray(...from: HSL): Gray;
  123. };
  124. type hsv = {
  125. rgb(from: HSV): RGB;
  126. rgb(...from: HSV): RGB;
  127. hsl(from: HSV): HSL;
  128. hsl(...from: HSV): HSL;
  129. hwb(from: HSV): HWB;
  130. hwb(...from: HSV): HWB;
  131. cmyk(from: HSV): CMYK;
  132. cmyk(...from: HSV): CMYK;
  133. xyz(from: HSV): XYZ;
  134. xyz(...from: HSV): XYZ;
  135. lab(from: HSV): LAB;
  136. lab(...from: HSV): LAB;
  137. lch(from: HSV): LCH;
  138. lch(...from: HSV): LCH;
  139. hex(from: HSV): HEX;
  140. hex(...from: HSV): HEX;
  141. keyword(from: HSV): Keyword;
  142. keyword(...from: HSV): Keyword;
  143. ansi16(from: HSV): ANSI16;
  144. ansi16(...from: HSV): ANSI16;
  145. ansi256(from: HSV): ANSI256;
  146. ansi256(...from: HSV): ANSI256;
  147. hcg(from: HSV): HCG;
  148. hcg(...from: HSV): HCG;
  149. apple(from: HSV): Apple;
  150. apple(...from: HSV): Apple;
  151. gray(from: HSV): Gray;
  152. gray(...from: HSV): Gray;
  153. };
  154. type hwb = {
  155. rgb(from: HWB): RGB;
  156. rgb(...from: HWB): RGB;
  157. hsl(from: HWB): HSL;
  158. hsl(...from: HWB): HSL;
  159. hsv(from: HWB): HSV;
  160. hsv(...from: HWB): HSV;
  161. cmyk(from: HWB): CMYK;
  162. cmyk(...from: HWB): CMYK;
  163. xyz(from: HWB): XYZ;
  164. xyz(...from: HWB): XYZ;
  165. lab(from: HWB): LAB;
  166. lab(...from: HWB): LAB;
  167. lch(from: HWB): LCH;
  168. lch(...from: HWB): LCH;
  169. hex(from: HWB): HEX;
  170. hex(...from: HWB): HEX;
  171. keyword(from: HWB): Keyword;
  172. keyword(...from: HWB): Keyword;
  173. ansi16(from: HWB): ANSI16;
  174. ansi16(...from: HWB): ANSI16;
  175. ansi256(from: HWB): ANSI256;
  176. ansi256(...from: HWB): ANSI256;
  177. hcg(from: HWB): HCG;
  178. hcg(...from: HWB): HCG;
  179. apple(from: HWB): Apple;
  180. apple(...from: HWB): Apple;
  181. gray(from: HWB): Gray;
  182. gray(...from: HWB): Gray;
  183. };
  184. type cmyk = {
  185. rgb(from: CMYK): RGB;
  186. rgb(...from: CMYK): RGB;
  187. hsl(from: CMYK): HSL;
  188. hsl(...from: CMYK): HSL;
  189. hsv(from: CMYK): HSV;
  190. hsv(...from: CMYK): HSV;
  191. hwb(from: CMYK): HWB;
  192. hwb(...from: CMYK): HWB;
  193. xyz(from: CMYK): XYZ;
  194. xyz(...from: CMYK): XYZ;
  195. lab(from: CMYK): LAB;
  196. lab(...from: CMYK): LAB;
  197. lch(from: CMYK): LCH;
  198. lch(...from: CMYK): LCH;
  199. hex(from: CMYK): HEX;
  200. hex(...from: CMYK): HEX;
  201. keyword(from: CMYK): Keyword;
  202. keyword(...from: CMYK): Keyword;
  203. ansi16(from: CMYK): ANSI16;
  204. ansi16(...from: CMYK): ANSI16;
  205. ansi256(from: CMYK): ANSI256;
  206. ansi256(...from: CMYK): ANSI256;
  207. hcg(from: CMYK): HCG;
  208. hcg(...from: CMYK): HCG;
  209. apple(from: CMYK): Apple;
  210. apple(...from: CMYK): Apple;
  211. gray(from: CMYK): Gray;
  212. gray(...from: CMYK): Gray;
  213. };
  214. type xyz = {
  215. rgb(from: XYZ): RGB;
  216. rgb(...from: XYZ): RGB;
  217. hsl(from: XYZ): HSL;
  218. hsl(...from: XYZ): HSL;
  219. hsv(from: XYZ): HSV;
  220. hsv(...from: XYZ): HSV;
  221. hwb(from: XYZ): HWB;
  222. hwb(...from: XYZ): HWB;
  223. cmyk(from: XYZ): CMYK;
  224. cmyk(...from: XYZ): CMYK;
  225. lab(from: XYZ): LAB;
  226. lab(...from: XYZ): LAB;
  227. lch(from: XYZ): LCH;
  228. lch(...from: XYZ): LCH;
  229. hex(from: XYZ): HEX;
  230. hex(...from: XYZ): HEX;
  231. keyword(from: XYZ): Keyword;
  232. keyword(...from: XYZ): Keyword;
  233. ansi16(from: XYZ): ANSI16;
  234. ansi16(...from: XYZ): ANSI16;
  235. ansi256(from: XYZ): ANSI256;
  236. ansi256(...from: XYZ): ANSI256;
  237. hcg(from: XYZ): HCG;
  238. hcg(...from: XYZ): HCG;
  239. apple(from: XYZ): Apple;
  240. apple(...from: XYZ): Apple;
  241. gray(from: XYZ): Gray;
  242. gray(...from: XYZ): Gray;
  243. };
  244. type lab = {
  245. rgb(from: LAB): RGB;
  246. rgb(...from: LAB): RGB;
  247. hsl(from: LAB): HSL;
  248. hsl(...from: LAB): HSL;
  249. hsv(from: LAB): HSV;
  250. hsv(...from: LAB): HSV;
  251. hwb(from: LAB): HWB;
  252. hwb(...from: LAB): HWB;
  253. cmyk(from: LAB): CMYK;
  254. cmyk(...from: LAB): CMYK;
  255. xyz(from: LAB): XYZ;
  256. xyz(...from: LAB): XYZ;
  257. lch(from: LAB): LCH;
  258. lch(...from: LAB): LCH;
  259. hex(from: LAB): HEX;
  260. hex(...from: LAB): HEX;
  261. keyword(from: LAB): Keyword;
  262. keyword(...from: LAB): Keyword;
  263. ansi16(from: LAB): ANSI16;
  264. ansi16(...from: LAB): ANSI16;
  265. ansi256(from: LAB): ANSI256;
  266. ansi256(...from: LAB): ANSI256;
  267. hcg(from: LAB): HCG;
  268. hcg(...from: LAB): HCG;
  269. apple(from: LAB): Apple;
  270. apple(...from: LAB): Apple;
  271. gray(from: LAB): Gray;
  272. gray(...from: LAB): Gray;
  273. };
  274. type lch = {
  275. rgb(from: LCH): RGB;
  276. rgb(...from: LCH): RGB;
  277. hsl(from: LCH): HSL;
  278. hsl(...from: LCH): HSL;
  279. hsv(from: LCH): HSV;
  280. hsv(...from: LCH): HSV;
  281. hwb(from: LCH): HWB;
  282. hwb(...from: LCH): HWB;
  283. cmyk(from: LCH): CMYK;
  284. cmyk(...from: LCH): CMYK;
  285. xyz(from: LCH): XYZ;
  286. xyz(...from: LCH): XYZ;
  287. lab(from: LCH): LAB;
  288. lab(...from: LCH): LAB;
  289. hex(from: LCH): HEX;
  290. hex(...from: LCH): HEX;
  291. keyword(from: LCH): Keyword;
  292. keyword(...from: LCH): Keyword;
  293. ansi16(from: LCH): ANSI16;
  294. ansi16(...from: LCH): ANSI16;
  295. ansi256(from: LCH): ANSI256;
  296. ansi256(...from: LCH): ANSI256;
  297. hcg(from: LCH): HCG;
  298. hcg(...from: LCH): HCG;
  299. apple(from: LCH): Apple;
  300. apple(...from: LCH): Apple;
  301. gray(from: LCH): Gray;
  302. gray(...from: LCH): Gray;
  303. };
  304. type hex = {
  305. rgb(from: HEX): RGB;
  306. hsl(from: HEX): HSL;
  307. hsv(from: HEX): HSV;
  308. hwb(from: HEX): HWB;
  309. cmyk(from: HEX): CMYK;
  310. xyz(from: HEX): XYZ;
  311. lab(from: HEX): LAB;
  312. lch(from: HEX): LCH;
  313. keyword(from: HEX): Keyword;
  314. ansi16(from: HEX): ANSI16;
  315. ansi256(from: HEX): ANSI256;
  316. hcg(from: HEX): HCG;
  317. apple(from: HEX): Apple;
  318. gray(from: HEX): Gray;
  319. };
  320. type keyword = {
  321. rgb(from: Keyword): RGB;
  322. hsl(from: Keyword): HSL;
  323. hsv(from: Keyword): HSV;
  324. hwb(from: Keyword): HWB;
  325. cmyk(from: Keyword): CMYK;
  326. xyz(from: Keyword): XYZ;
  327. lab(from: Keyword): LAB;
  328. lch(from: Keyword): LCH;
  329. hex(from: Keyword): HEX;
  330. ansi16(from: Keyword): ANSI16;
  331. ansi256(from: Keyword): ANSI256;
  332. hcg(from: Keyword): HCG;
  333. apple(from: Keyword): Apple;
  334. gray(from: Keyword): Gray;
  335. };
  336. type ansi16 = {
  337. rgb(from: ANSI16): RGB;
  338. hsl(from: ANSI16): HSL;
  339. hsv(from: ANSI16): HSV;
  340. hwb(from: ANSI16): HWB;
  341. cmyk(from: ANSI16): CMYK;
  342. xyz(from: ANSI16): XYZ;
  343. lab(from: ANSI16): LAB;
  344. lch(from: ANSI16): LCH;
  345. hex(from: ANSI16): HEX;
  346. keyword(from: ANSI16): Keyword;
  347. ansi256(from: ANSI16): ANSI256;
  348. hcg(from: ANSI16): HCG;
  349. apple(from: ANSI16): Apple;
  350. gray(from: ANSI16): Gray;
  351. };
  352. type ansi256 = {
  353. rgb(from: ANSI256): RGB;
  354. hsl(from: ANSI256): HSL;
  355. hsv(from: ANSI256): HSV;
  356. hwb(from: ANSI256): HWB;
  357. cmyk(from: ANSI256): CMYK;
  358. xyz(from: ANSI256): XYZ;
  359. lab(from: ANSI256): LAB;
  360. lch(from: ANSI256): LCH;
  361. hex(from: ANSI256): HEX;
  362. keyword(from: ANSI256): Keyword;
  363. ansi16(from: ANSI256): ANSI16;
  364. hcg(from: ANSI256): HCG;
  365. apple(from: ANSI256): Apple;
  366. gray(from: ANSI256): Gray;
  367. };
  368. type hcg = {
  369. rgb(from: HCG): RGB;
  370. rgb(...from: HCG): RGB;
  371. hsl(from: HCG): HSL;
  372. hsl(...from: HCG): HSL;
  373. hsv(from: HCG): HSV;
  374. hsv(...from: HCG): HSV;
  375. hwb(from: HCG): HWB;
  376. hwb(...from: HCG): HWB;
  377. cmyk(from: HCG): CMYK;
  378. cmyk(...from: HCG): CMYK;
  379. xyz(from: HCG): XYZ;
  380. xyz(...from: HCG): XYZ;
  381. lab(from: HCG): LAB;
  382. lab(...from: HCG): LAB;
  383. lch(from: HCG): LCH;
  384. lch(...from: HCG): LCH;
  385. hex(from: HCG): HEX;
  386. hex(...from: HCG): HEX;
  387. keyword(from: HCG): Keyword;
  388. keyword(...from: HCG): Keyword;
  389. ansi16(from: HCG): ANSI16;
  390. ansi16(...from: HCG): ANSI16;
  391. ansi256(from: HCG): ANSI256;
  392. ansi256(...from: HCG): ANSI256;
  393. apple(from: HCG): Apple;
  394. apple(...from: HCG): Apple;
  395. gray(from: HCG): Gray;
  396. gray(...from: HCG): Gray;
  397. };
  398. type apple = {
  399. rgb(from: Apple): RGB;
  400. rgb(...from: Apple): RGB;
  401. hsl(from: Apple): HSL;
  402. hsl(...from: Apple): HSL;
  403. hsv(from: Apple): HSV;
  404. hsv(...from: Apple): HSV;
  405. hwb(from: Apple): HWB;
  406. hwb(...from: Apple): HWB;
  407. cmyk(from: Apple): CMYK;
  408. cmyk(...from: Apple): CMYK;
  409. xyz(from: Apple): XYZ;
  410. xyz(...from: Apple): XYZ;
  411. lab(from: Apple): LAB;
  412. lab(...from: Apple): LAB;
  413. lch(from: Apple): LCH;
  414. lch(...from: Apple): LCH;
  415. hex(from: Apple): HEX;
  416. hex(...from: Apple): HEX;
  417. keyword(from: Apple): Keyword;
  418. keyword(...from: Apple): Keyword;
  419. ansi16(from: Apple): ANSI16;
  420. ansi16(...from: Apple): ANSI16;
  421. ansi256(from: Apple): ANSI256;
  422. ansi256(...from: Apple): ANSI256;
  423. hcg(from: Apple): HCG;
  424. hcg(...from: Apple): HCG;
  425. gray(from: Apple): Gray;
  426. gray(...from: Apple): Gray;
  427. };
  428. type gray = {
  429. rgb(from: Gray): RGB;
  430. rgb(...from: Gray): RGB;
  431. hsl(from: Gray): HSL;
  432. hsl(...from: Gray): HSL;
  433. hsv(from: Gray): HSV;
  434. hsv(...from: Gray): HSV;
  435. hwb(from: Gray): HWB;
  436. hwb(...from: Gray): HWB;
  437. cmyk(from: Gray): CMYK;
  438. cmyk(...from: Gray): CMYK;
  439. xyz(from: Gray): XYZ;
  440. xyz(...from: Gray): XYZ;
  441. lab(from: Gray): LAB;
  442. lab(...from: Gray): LAB;
  443. lch(from: Gray): LCH;
  444. lch(...from: Gray): LCH;
  445. hex(from: Gray): HEX;
  446. hex(...from: Gray): HEX;
  447. keyword(from: Gray): Keyword;
  448. keyword(...from: Gray): Keyword;
  449. ansi16(from: Gray): ANSI16;
  450. ansi16(...from: Gray): ANSI16;
  451. ansi256(from: Gray): ANSI256;
  452. ansi256(...from: Gray): ANSI256;
  453. hcg(from: Gray): HCG;
  454. hcg(...from: Gray): HCG;
  455. apple(from: Gray): Apple;
  456. apple(...from: Gray): Apple;
  457. };
  458. }
  459. declare function route(fromModel: "rgb"): route.rgb;
  460. declare function route(fromModel: "hsl"): route.hsl;
  461. declare function route(fromModel: "hsv"): route.hsv;
  462. declare function route(fromModel: "hwb"): route.hwb;
  463. declare function route(fromModel: "cmyk"): route.cmyk;
  464. declare function route(fromModel: "xyz"): route.xyz;
  465. declare function route(fromModel: "lab"): route.lab;
  466. declare function route(fromModel: "lch"): route.lch;
  467. declare function route(fromModel: "hex"): route.hex;
  468. declare function route(fromModel: "keyword"): route.keyword;
  469. declare function route(fromModel: "ansi16"): route.ansi16;
  470. declare function route(fromModel: "ansi256"): route.ansi256;
  471. declare function route(fromModel: "hcg"): route.hcg;
  472. declare function route(fromModel: "apple"): route.apple;
  473. declare function route(fromModel: "gray"): route.gray;
  474. type Convert = {
  475. rgb: {
  476. channels: Channels;
  477. labels: "rgb";
  478. hsl: {
  479. (...rgb: RGB): HSL;
  480. raw: (...rgb: RGB) => HSL;
  481. };
  482. hsv: {
  483. (...rgb: RGB): HSV;
  484. raw: (...rgb: RGB) => HSV;
  485. };
  486. hwb: {
  487. (...rgb: RGB): HWB;
  488. raw: (...rgb: RGB) => HWB;
  489. };
  490. hcg: {
  491. (...rgb: RGB): HCG;
  492. raw: (...rgb: RGB) => HCG;
  493. };
  494. cmyk: {
  495. (...rgb: RGB): CMYK;
  496. raw: (...rgb: RGB) => CMYK;
  497. };
  498. keyword: {
  499. (...rgb: RGB): Keyword;
  500. raw: (...rgb: RGB) => Keyword;
  501. };
  502. ansi16: {
  503. (...rgb: RGB): ANSI16;
  504. raw: (...rgb: RGB) => ANSI16;
  505. };
  506. ansi256: {
  507. (...rgb: RGB): ANSI256;
  508. raw: (...rgb: RGB) => ANSI256;
  509. };
  510. apple: {
  511. (...rgb: RGB): Apple;
  512. raw: (...rgb: RGB) => Apple;
  513. };
  514. hex: {
  515. (...rgb: RGB): HEX;
  516. raw: (...rgb: RGB) => HEX;
  517. };
  518. gray: {
  519. (...rgb: RGB): Gray;
  520. raw: (...rgb: RGB) => Gray;
  521. };
  522. } & route.rgb & {
  523. [F in keyof route.rgb]: {
  524. raw: route.rgb[F];
  525. };
  526. };
  527. keyword: {
  528. channels: Channels;
  529. rgb: {
  530. (keyword: Keyword): RGB;
  531. raw: (keyword: Keyword) => RGB;
  532. };
  533. } & route.keyword & {
  534. [F in keyof route.keyword]: {
  535. raw: route.keyword[F];
  536. };
  537. };
  538. hsl: {
  539. channels: Channels;
  540. labels: "hsl";
  541. rgb: {
  542. (...hsl: HSL): RGB;
  543. raw: (...hsl: HSL) => RGB;
  544. };
  545. hsv: {
  546. (...hsl: HSL): HSV;
  547. raw: (...hsl: HSL) => HSV;
  548. };
  549. hcg: {
  550. (...hsl: HSL): HCG;
  551. raw: (...hsl: HSL) => HCG;
  552. };
  553. } & route.hsl & {
  554. [F in keyof route.hsl]: {
  555. raw: route.hsl[F];
  556. };
  557. };
  558. hsv: {
  559. channels: Channels;
  560. labels: "hsv";
  561. hcg: {
  562. (...hsv: HSV): HCG;
  563. raw: (...hsv: HSV) => HCG;
  564. };
  565. rgb: {
  566. (...hsv: HSV): RGB;
  567. raw: (...hsv: HSV) => RGB;
  568. };
  569. hsv: {
  570. (...hsv: HSV): HSV;
  571. raw: (...hsv: HSV) => HSV;
  572. };
  573. hsl: {
  574. (...hsv: HSV): HSL;
  575. raw: (...hsv: HSV) => HSL;
  576. };
  577. hwb: {
  578. (...hsv: HSV): HWB;
  579. raw: (...hsv: HSV) => HWB;
  580. };
  581. ansi16: {
  582. (...hsv: HSV): ANSI16;
  583. raw: (...hsv: HSV) => ANSI16;
  584. };
  585. } & route.hsv & {
  586. [F in keyof route.hsv]: {
  587. raw: route.hsv[F];
  588. };
  589. };
  590. hwb: {
  591. channels: Channels;
  592. labels: "hwb";
  593. hcg: {
  594. (...hwb: HWB): HCG;
  595. raw: (...hwb: HWB) => HCG;
  596. };
  597. rgb: {
  598. (...hwb: HWB): RGB;
  599. raw: (...hwb: HWB) => RGB;
  600. };
  601. } & route.hwb & {
  602. [F in keyof route.hwb]: {
  603. raw: route.hwb[F];
  604. };
  605. };
  606. cmyk: {
  607. channels: Channels;
  608. labels: "cmyk";
  609. rgb: {
  610. (...cmyk: CMYK): RGB;
  611. raw: (...cmyk: CMYK) => RGB;
  612. };
  613. } & route.cmyk & {
  614. [F in keyof route.cmyk]: {
  615. raw: route.cmyk[F];
  616. };
  617. };
  618. xyz: {
  619. channels: Channels;
  620. labels: "xyz";
  621. rgb: {
  622. (...xyz: XYZ): RGB;
  623. raw: (...xyz: XYZ) => RGB;
  624. };
  625. lab: {
  626. (...xyz: XYZ): LAB;
  627. raw: (...xyz: XYZ) => LAB;
  628. };
  629. } & route.xyz & {
  630. [F in keyof route.xyz]: {
  631. raw: route.xyz[F];
  632. };
  633. };
  634. lab: {
  635. channels: Channels;
  636. labels: "lab";
  637. xyz: {
  638. (...lab: LAB): XYZ;
  639. raw: (...lab: LAB) => XYZ;
  640. };
  641. lch: {
  642. (...lab: LAB): LCH;
  643. raw: (...lab: LAB) => LCH;
  644. };
  645. } & route.lab & {
  646. [F in keyof route.lab]: {
  647. raw: route.lab[F];
  648. };
  649. };
  650. lch: {
  651. channels: Channels;
  652. labels: "lch";
  653. lab: {
  654. (...lch: LCH): LAB;
  655. raw: (...lch: LCH) => LAB;
  656. };
  657. } & route.lch & {
  658. [F in keyof route.lch]: {
  659. raw: route.lch[F];
  660. };
  661. };
  662. hex: {
  663. channels: Channels;
  664. labels: [
  665. "hex"
  666. ];
  667. rgb: {
  668. (hex: HEX): RGB;
  669. raw: (hex: HEX) => RGB;
  670. };
  671. } & route.hex & {
  672. [F in keyof route.hex]: {
  673. raw: route.hex[F];
  674. };
  675. };
  676. ansi16: {
  677. channels: Channels;
  678. labels: [
  679. "ansi16"
  680. ];
  681. rgb: {
  682. (ansi16: ANSI16): RGB;
  683. raw: (ansi16: ANSI16) => RGB;
  684. };
  685. } & route.ansi16 & {
  686. [F in keyof route.ansi16]: {
  687. raw: route.ansi16[F];
  688. };
  689. };
  690. ansi256: {
  691. channels: Channels;
  692. labels: [
  693. "ansi256"
  694. ];
  695. rgb: {
  696. (ansi256: ANSI256): RGB;
  697. raw: (ansi256: ANSI256) => RGB;
  698. };
  699. } & route.ansi256 & {
  700. [F in keyof route.ansi256]: {
  701. raw: route.ansi256[F];
  702. };
  703. };
  704. hcg: {
  705. channels: Channels;
  706. labels: [
  707. "h",
  708. "c",
  709. "g"
  710. ];
  711. rgb: {
  712. (...hcg: HCG): RGB;
  713. raw: (...hcg: HCG) => RGB;
  714. };
  715. hsv: {
  716. (...hcg: HCG): HSV;
  717. raw: (...hcg: HCG) => HSV;
  718. };
  719. hwb: {
  720. (...hcg: HCG): HWB;
  721. raw: (...hcg: HCG) => HWB;
  722. };
  723. } & route.hcg & {
  724. [F in keyof route.hcg]: {
  725. raw: route.hcg[F];
  726. };
  727. };
  728. apple: {
  729. channels: Channels;
  730. labels: [
  731. "r16",
  732. "g16",
  733. "b16"
  734. ];
  735. rgb: {
  736. (...apple: Apple): RGB;
  737. raw: (...apple: Apple) => RGB;
  738. };
  739. } & route.apple & {
  740. [F in keyof route.apple]: {
  741. raw: route.apple[F];
  742. };
  743. };
  744. gray: {
  745. channels: Channels;
  746. labels: [
  747. "gray"
  748. ];
  749. rgb: {
  750. (...gray: Gray): RGB;
  751. raw: (...gray: Gray) => RGB;
  752. };
  753. hsl: {
  754. (...gray: Gray): HSL;
  755. raw: (...gray: Gray) => HSL;
  756. };
  757. hsv: {
  758. (...gray: Gray): HSV;
  759. raw: (...gray: Gray) => HSV;
  760. };
  761. hwb: {
  762. (...gray: Gray): HWB;
  763. raw: (...gray: Gray) => HWB;
  764. };
  765. cmyk: {
  766. (...gray: Gray): CMYK;
  767. raw: (...gray: Gray) => CMYK;
  768. };
  769. lab: {
  770. (...gray: Gray): LAB;
  771. raw: (...gray: Gray) => LAB;
  772. };
  773. hex: {
  774. (...gray: Gray): HEX;
  775. raw: (...gray: Gray) => HEX;
  776. };
  777. } & route.gray & {
  778. [F in keyof route.gray]: {
  779. raw: route.gray[F];
  780. };
  781. };
  782. };
  783. declare const convert: Convert;
  784. export type ColorLike = ColorInstance | string | ArrayLike<number> | number | Record<string, any>;
  785. export type ColorJson = {
  786. model: string;
  787. color: number[];
  788. valpha: number;
  789. };
  790. export type ColorObject = {
  791. alpha?: number | undefined;
  792. } & Record<string, number>;
  793. // eslint-disable-next-line @typescript-eslint/consistent-type-definitions
  794. export interface ColorInstance {
  795. toString(): string;
  796. // eslint-disable-next-line @typescript-eslint/naming-convention
  797. toJSON(): ColorJson;
  798. string(places?: number): string;
  799. percentString(places?: number): string;
  800. array(): number[];
  801. object(): ColorObject;
  802. unitArray(): number[];
  803. unitObject(): {
  804. r: number;
  805. g: number;
  806. b: number;
  807. alpha?: number | undefined;
  808. };
  809. round(places?: number): ColorInstance;
  810. alpha(): number;
  811. alpha(value: number): ColorInstance;
  812. red(): number;
  813. red(value: number): ColorInstance;
  814. green(): number;
  815. green(value: number): ColorInstance;
  816. blue(): number;
  817. blue(value: number): ColorInstance;
  818. hue(): number;
  819. hue(value: number): ColorInstance;
  820. saturationl(): number;
  821. saturationl(value: number): ColorInstance;
  822. lightness(): number;
  823. lightness(value: number): ColorInstance;
  824. saturationv(): number;
  825. saturationv(value: number): ColorInstance;
  826. value(): number;
  827. value(value: number): ColorInstance;
  828. chroma(): number;
  829. chroma(value: number): ColorInstance;
  830. gray(): number;
  831. gray(value: number): ColorInstance;
  832. white(): number;
  833. white(value: number): ColorInstance;
  834. wblack(): number;
  835. wblack(value: number): ColorInstance;
  836. cyan(): number;
  837. cyan(value: number): ColorInstance;
  838. magenta(): number;
  839. magenta(value: number): ColorInstance;
  840. yellow(): number;
  841. yellow(value: number): ColorInstance;
  842. black(): number;
  843. black(value: number): ColorInstance;
  844. x(): number;
  845. x(value: number): ColorInstance;
  846. y(): number;
  847. y(value: number): ColorInstance;
  848. z(): number;
  849. z(value: number): ColorInstance;
  850. l(): number;
  851. l(value: number): ColorInstance;
  852. a(): number;
  853. a(value: number): ColorInstance;
  854. b(): number;
  855. b(value: number): ColorInstance;
  856. keyword(): string;
  857. keyword<V extends string>(value: V): ColorInstance;
  858. hex(): string;
  859. hex<V extends string>(value: V): ColorInstance;
  860. hexa(): string;
  861. hexa<V extends string>(value: V): ColorInstance;
  862. rgbNumber(): number;
  863. luminosity(): number;
  864. contrast(color2: ColorInstance): number;
  865. level(color2: ColorInstance): "AAA" | "AA" | "";
  866. isDark(): boolean;
  867. isLight(): boolean;
  868. negate(): ColorInstance;
  869. lighten(ratio: number): ColorInstance;
  870. darken(ratio: number): ColorInstance;
  871. saturate(ratio: number): ColorInstance;
  872. desaturate(ratio: number): ColorInstance;
  873. whiten(ratio: number): ColorInstance;
  874. blacken(ratio: number): ColorInstance;
  875. grayscale(): ColorInstance;
  876. fade(ratio: number): ColorInstance;
  877. opaquer(ratio: number): ColorInstance;
  878. rotate(degrees: number): ColorInstance;
  879. mix(mixinColor: ColorInstance, weight?: number): ColorInstance;
  880. rgb(...arguments_: number[]): ColorInstance;
  881. hsl(...arguments_: number[]): ColorInstance;
  882. hsv(...arguments_: number[]): ColorInstance;
  883. hwb(...arguments_: number[]): ColorInstance;
  884. cmyk(...arguments_: number[]): ColorInstance;
  885. xyz(...arguments_: number[]): ColorInstance;
  886. lab(...arguments_: number[]): ColorInstance;
  887. lch(...arguments_: number[]): ColorInstance;
  888. ansi16(...arguments_: number[]): ColorInstance;
  889. ansi256(...arguments_: number[]): ColorInstance;
  890. hcg(...arguments_: number[]): ColorInstance;
  891. apple(...arguments_: number[]): ColorInstance;
  892. }
  893. export type ColorConstructor = {
  894. (object?: ColorLike, model?: keyof (typeof convert)): ColorInstance;
  895. new (object?: ColorLike, model?: keyof (typeof convert)): ColorInstance;
  896. rgb(...value: number[]): ColorInstance;
  897. rgb(color: ColorLike): ColorInstance;
  898. hsl(...value: number[]): ColorInstance;
  899. hsl(color: ColorLike): ColorInstance;
  900. hsv(...value: number[]): ColorInstance;
  901. hsv(color: ColorLike): ColorInstance;
  902. hwb(...value: number[]): ColorInstance;
  903. hwb(color: ColorLike): ColorInstance;
  904. cmyk(...value: number[]): ColorInstance;
  905. cmyk(color: ColorLike): ColorInstance;
  906. xyz(...value: number[]): ColorInstance;
  907. xyz(color: ColorLike): ColorInstance;
  908. lab(...value: number[]): ColorInstance;
  909. lab(color: ColorLike): ColorInstance;
  910. lch(...value: number[]): ColorInstance;
  911. lch(color: ColorLike): ColorInstance;
  912. ansi16(...value: number[]): ColorInstance;
  913. ansi16(color: ColorLike): ColorInstance;
  914. ansi256(...value: number[]): ColorInstance;
  915. ansi256(color: ColorLike): ColorInstance;
  916. hcg(...value: number[]): ColorInstance;
  917. hcg(color: ColorLike): ColorInstance;
  918. apple(...value: number[]): ColorInstance;
  919. apple(color: ColorLike): ColorInstance;
  920. };
  921. // eslint-disable-next-line @typescript-eslint/naming-convention
  922. declare const Color: ColorConstructor;
  923. export {
  924. Color as default,
  925. };
  926. export {};