node-libpng
Version:
Unofficial bindings for node to libpng.
34 lines (33 loc) • 969 B
TypeScript
import { ColorRGBA } from "./rgba";
/**
* Represents a color of color type `ColorType.GRAY_SCALE`.
*
* @see ColorType
*/
export declare type ColorGrayScale = [number] & {
gray: number;
};
/**
* Create a new color of type `ColorGrayScale`.
*
* @param gray The value for the `gray` part of the color.
*
* @return The color in gray scale representation.
*/
export declare function colorGrayScale(gray: number): ColorGrayScale;
/**
* Checks if the given parameter is a color of type `ColorGrayScale`.
*
* @param color The input to check.
*
* @return `true` if `color` was of type `ColorGrayScale` and `false` otherwise.
*/
export declare function isColorGrayScale(color: any): color is ColorGrayScale;
/**
* Converts a color of type `ColorGrayScale` to `ColorRGBA`.
*
* @param color The color to convert.
*
* @return The converted color in rgba format.
*/
export declare function convertGrayScaleToRGBA(grayScaleAlpha: ColorGrayScale): ColorRGBA;