import { z } from 'zod';

declare const hexZ: z.ZodString;
export type RGBA = [number, number, number, number];
export type HSLA = [number, number, number, number];
export type RGB = [number, number, number];
export type Hex = z.infer<typeof hexZ>;
declare const crudeColor: z.ZodObject<{
    rgba255: z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>;
}, "strip", z.ZodTypeAny, {
    rgba255: [number, number, number, number];
}, {
    rgba255: [number, number, number, number];
}>;
type CrudeBase = z.infer<typeof crudeColor>;
export declare const toHex: ((color: Crude) => string) & ((color?: Crude) => string | undefined);
/**
 * An unparsed representation of a color i.e. a value that can be converted into
 * a Color object.
 */
export type Crude = Hex | RGBA | Color | string | RGB | CrudeBase;
/**
 * Converts a crude color to its CSS representation. If the color cannot be parsed,
 *
 *
 * @param color -
 */
export declare const cssString: (color?: Crude) => string | undefined;
/**
 * A color with an alpha channel. It can be used to easily transform
 * color values from one format to another, as well as make modifications to the color.
 */
export declare class Color {
    /**
     * @property the color as an RGBA tuple, with each color value between 0 and 255,
     * and the alpha value between 0 and 1.
     */
    readonly rgba255: RGBA;
    /**
     * @constructor Creates a new color from the given color value. The color value can be
     * a hex string, an array of RGB or RGBA values, or another color.
     *
     * @param color - The color value to create the color from. If the color value is a
     * string, it must be a valid hex color (with or without the '#') with a hasheless
     * length 6 or 8. If the hex color is 8 characters long, the last twoc haracters are
     * used as the alpha value. If the color value is an array, it must be an array of
     * length 3 or 4, with each value between 0 and 255. If the color value is another
     * color, the color will be copied.
     *
     * @param alpha - An optional alpha value to set. If the color value carries its own
     * alpha value, this value will be ignored. Defaults to 1.
     */
    constructor(color: Crude, alpha?: number);
    /**
     * @returns true if the given color is semantically equal to this color. Different
     * representations of the same color are considered equal (e.g. hex and rgba).
     */
    equals(other?: Crude): boolean;
    /**
     * @returns the hex representation of the color. If the color has an opacity of 1,
     * the returned hex will be 6 characters long. Otherwise, it will be 8 characters
     * long.
     */
    get hex(): string;
    /**
     * @returns the color as a CSS RGBA string.
     */
    get rgbaCSS(): string;
    /**
     * @returns the color as a CSS RGB string with no alpha value.
     */
    get rgbCSS(): string;
    /**
     * @returns the color as an RGB string, with each color value between 0 and 255.
     * @example "255, 255, 255"
     */
    get rgbString(): string;
    /**
     * @returns the color as an RGBA tuple, with each color value between 0 and 1,
     * and the alpha value between 0 and 1.
     */
    get rgba1(): RGBA;
    get rgb1(): RGB;
    /** @returns the red value of the color, between 0 and 255. */
    get r(): number;
    /** @returns the green value of the color, between 0 and 255. */
    get g(): number;
    /** @returns the blue value of the color, between 0 and 255. */
    get b(): number;
    /** @returns the alpha value of the color, between 0 and 1. */
    get a(): number;
    /** @returns true if all RGBA values are 0. */
    get isZero(): boolean;
    get hsla(): HSLA;
    /**
     * Creates a new color with the given alpha.
     *
     * @param alpha - The alpha value to set. If the value is greater than 1, it will be
     * divided by 100.
     * @returns A new color with the given alpha.
     */
    setAlpha(alpha: number): Color;
    /**
     * @returns the luminance of the color, between 0 and 1.
     */
    get luminance(): number;
    /**
     * @returns the contrast ratio between this color and the given color. The contrast
     * ratio is a number between 1 and 21, where 1 is the lowest contrast and 21 is the
     * highest.
     * @param other
     * @returns
     */
    contrast(other: Crude): number;
    pickByContrast(...colors: Crude[]): Color;
    get isDark(): boolean;
    get isLight(): boolean;
    static readonly z: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>, z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>, z.ZodType<Color, z.ZodTypeDef, Color>, z.ZodObject<{
        rgba255: z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>;
    }, "strip", z.ZodTypeAny, {
        rgba255: [number, number, number, number];
    }, {
        rgba255: [number, number, number, number];
    }>]>, Color, string | [number, number, number, number] | {
        rgba255: [number, number, number, number];
    } | Color | [number, number, number]>;
    private static fromHex;
}
/** A totally zero color with no alpha. */
export declare const ZERO: Color;
export declare const fromHSLA: (hsla: RGBA) => RGBA;
export {};
//# sourceMappingURL=color.d.ts.map