UNPKG

476 BTypeScriptView Raw
1import type { IColor } from './interfaces';
2/**
3 * Converts a CSS color string to a color object.
4 * Note that hex colors *must* be prefixed with # to be considered valid.
5 *
6 * `inputColor` will be used unmodified as the `str` property of the returned object.
7 * Alpha defaults to 100 if not specified in `inputColor`.
8 * Returns undefined if the color string is invalid/not recognized.
9 */
10export declare function getColorFromString(inputColor: string): IColor | undefined;