| 1 |
/** |
| 2 |
* @packageDocumentation |
| 3 |
* A functional, tree-shakeable version of the Color.js API. |
| 4 |
* This module allows developers to selectively import |
| 5 |
* the classes and functions that they wish to use in their project. |
| 6 |
* Import as `colorjs.io/fn` |
| 7 |
*/ |
| 8 |
export { default as ColorSpace } from "./ColorSpace.js"; |
| 9 |
export { default as RGBColorSpace } from "./RGBColorSpace.js"; |
| 10 |
export { default as GamutRelativeColorSpace } from "./GamutRelativeColorSpace.js"; |
| 11 |
export { default as hooks, Hooks } from "./hooks.js"; |
| 12 |
export { default as defaults } from "./defaults.js"; |
| 13 |
export { default as getColor } from "./getColor.js"; |
| 14 |
export { default as tryColor } from "./tryColor.js"; |
| 15 |
export { default as get } from "./get.js"; |
| 16 |
export { default as getAll } from "./getAll.js"; |
| 17 |
export { default as set } from "./set.js"; |
| 18 |
export { default as setAll } from "./setAll.js"; |
| 19 |
export { default as parse } from "./parse.js"; |
| 20 |
export { default as to } from "./to.js"; |
| 21 |
export { default as serialize } from "./serialize.js"; |
| 22 |
export { default as display } from "./display.js"; |
| 23 |
export { default as inGamut } from "./inGamut.js"; |
| 24 |
export { default as toGamut, toGamutCSS } from "./toGamut.js"; |
| 25 |
export { default as distance } from "./distance.js"; |
| 26 |
export { default as deltas } from "./deltas.js"; |
| 27 |
export { default as equals } from "./equals.js"; |
| 28 |
export { default as contrast } from "./contrast.js"; |
| 29 |
export { default as clone } from "./clone.js"; |
| 30 |
export { getLuminance, setLuminance } from "./luminance.js"; |
| 31 |
export { uv, xy } from "./chromaticity.js"; |
| 32 |
export * from "./contrast/index.js"; |
| 33 |
export { default as deltaE } from "./deltaE.js"; |
| 34 |
export * from "./deltaE/index.js"; |
| 35 |
export { default as deltaEMethods } from "./deltaE/index.js"; |
| 36 |
export * from "./variations.js"; |
| 37 |
export { mix, steps, range, isRange } from "./interpolation.js"; |
| 38 |
|
| 39 |
// Export all color spaces as a single object as well so they can be registered in one go (#661) |
| 40 |
import * as spaces from "./spaces/index-fn.js"; |
| 41 |
export { spaces } |
| 42 |
export * from "./spaces/index-fn.js"; |
| 43 |
|
| 44 |
// Type re-exports |
| 45 |
// Re-exported from src/color.d.ts |
| 46 |
/** @typedef {import("./types.js").ColorConstructor} ColorConstructor */ |
| 47 |
/** @typedef {import("./types.js").ColorObject} ColorObject */ |
| 48 |
/** @typedef {import("./types.js").ColorTypes} ColorTypes */ |
| 49 |
/** @typedef {import("./types.js").Coords} Coords */ |
| 50 |
/** @typedef {import("./types.js").DefineFunctionCode} DefineFunctionCode */ |
| 51 |
/** @typedef {import("./types.js").DefineFunctionOptions} DefineFunctionOptions */ |
| 52 |
/** @typedef {import("./types.js").DefineFunctionHybrid} DefineFunctionHybrid */ |
| 53 |
/** @typedef {import("./types.js").PlainColorObject} PlainColorObject */ |
| 54 |
/** @typedef {import("./types.js").SpaceAccessor} SpaceAccessor */ |
| 55 |
/** |
| 56 |
* @typedef {import("./types.js").ToColorPrototype<T>} ToColorPrototype |
| 57 |
* @template {(...args: any[]) => any} T |
| 58 |
*/ |
| 59 |
// Re-exported from src/adapt.d.ts |
| 60 |
/** @typedef {import("./types.js").White} White */ |
| 61 |
// Re-exported from src/CATs.d.ts |
| 62 |
/** @typedef {import("./types.js").CAT} CAT */ |
| 63 |
// Re-exported from src/display.d.ts |
| 64 |
/** @typedef {import("./types.js").Display} Display */ |
| 65 |
// Re-exported from src/interpolation.d.ts |
| 66 |
/** @typedef {import("./types.js").Range} Range */ |
| 67 |
/** @typedef {import("./types.js").RangeOptions} RangeOptions */ |
| 68 |
/** @typedef {import("./types.js").MixOptions} MixOptions */ |
| 69 |
/** @typedef {import("./types.js").StepsOptions} StepsOptions */ |
| 70 |
// Re-exported from src/parse.d.ts |
| 71 |
/** @typedef {import("./types.js").ParseOptions} ParseOptions */ |
| 72 |
// Re-exported from src/rgbspace.d.ts |
| 73 |
/** @typedef {import("./types.js").RGBOptions} RGBOptions */ |
| 74 |
// Re-exported from src/serialize.d.ts |
| 75 |
/** @typedef {import("./types.js").SerializeOptions} SerializeOptions */ |
| 76 |
// Re-exported from src/space.d.ts |
| 77 |
/** @typedef {import("./types.js").Format} SpaceFormat */ |
| 78 |
/** @typedef {import("./types.js").CoordMeta} CoordMeta */ |
| 79 |
/** @typedef {import("./types.js").Ref} Ref */ |
| 80 |
/** @typedef {import("./types.js").SpaceOptions} SpaceOptions */ |
| 81 |
// Re-exported from src/deltas.d.ts |
| 82 |
/** @typedef {import("./types.js").DeltasReturn} DeltasReturn */ |