UNPKG

allc

Version:

A small typescript package for color conversion.

76 lines 2.18 kB
/** * Calculates the red component of an integer representation in the format `0xRRGGBB`. * **All other bits will be ignored, including the alpha channel**. * * @param integer The integer representation. * * @returns The red component. */ export declare const toRGBRFromInteger: (integer: number) => number; /** * Calculates the green component of an integer representation in the format `0xRRGGBB`. * **All other bits will be ignored, including the alpha channel**. * * @param integer The integer representation. * * @returns The green component. */ export declare const toRGBGFromInteger: (integer: number) => number; /** * Calculates the blue component of an integer representation in the format `0xRRGGBB`. * **All other bits will be ignored, including the alpha channel**. * * @param integer The integer representation. * * @returns The blue component. */ export declare const toRGBBFromInteger: (integer: number) => number; /** * Calculates the red component of a hex representation in either of the formats * listed below: * * * `"RGB"` * * `"#RGB"` * * `"RRGGBB"` * * `"#RRGGBB"` * * It ignores any following characters. Defaults to 0 if the string/component is invalid. * * @param hex The hex string. * * @returns The red component. */ export declare const toRGBRFromHexString: (hex: string) => number; /** * Calculates the green component of a hex representation in either of the formats * listed below: * * * `"RGB"` * * `"#RGB"` * * `"RRGGBB"` * * `"#RRGGBB"` * * It ignores any following characters. Defaults to 0 if the string/component is invalid. * * @param hex The hex string. * * @returns The green component. */ export declare const toRGBGFromHexString: (hex: string) => number; /** * Calculates the blue component of a hex representation in either of the formats * listed below: * * * `"RGB"` * * `"#RGB"` * * `"RRGGBB"` * * `"#RRGGBB"` * * It ignores any following characters. Defaults to 0 if the string/component is invalid. * * @param hex The hex string. * * @returns The blue component. */ export declare const toRGBBFromHexString: (hex: string) => number; //# sourceMappingURL=decode.d.ts.map