Installation
npm install --save @types/get-image-colors
Summary
This package contains type definitions for get-image-colors (https://github.com/colorjs/get-image-colors#readme).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/get-image-colors.
index.d.ts
/// <reference types="node" />
import { Color } from "chroma-js";
/**
* Extract colors from images. Supports GIF, JPG, PNG, and even SVG!
*/
declare function colorPalette(
input: Buffer | string,
typeOrOptions: string | colorPalette.Options,
callback: colorPalette.Callback,
): void;
declare function colorPalette(input: Buffer | string, typeOrOptions?: string | colorPalette.Options): Promise<Color[]>;
declare function colorPalette(input: Buffer | string, callback: colorPalette.Callback): void;
declare namespace colorPalette {
interface Options {
/**
* @default undefined
*/
type?: string | undefined;
/**
* @default 5
*/
count?: number | undefined;
}
/**
* If you don't like promises, you can use node-style callbacks too
*/
type Callback = (error: Error | null, colors: Color[]) => void;
}
export = colorPalette;
Additional Details
- Last updated: Tue, 07 Nov 2023 03:09:37 GMT
- Dependencies: @types/chroma-js, @types/node
Credits
These definitions were written by Piotr Błażejewicz.