node-libpng
Version:
Unofficial bindings for node to libpng.
38 lines (37 loc) • 1.05 kB
TypeScript
import { ColorRGBA } from "./rgba";
/**
* Represents a color of color type `ColorType.RGB`.
*
* @see ColorType
*/
export declare type ColorRGB = [number, number, number] & {
r: number;
g: number;
b: number;
};
/**
* Create a new color of type `number`.
*
* @param r The value for the `red` part of the color.
* @param g The value for the `green` part of the color.
* @param b The value for the `blue` part of the color.
*
* @return The color in rgb representation.
*/
export declare function colorRGB(r: number, g: number, b: number): ColorRGB;
/**
* Checks if the given parameter is a color of type `ColorRGB`.
*
* @param color The input to check.
*
* @return `true` if `color` was of type `ColorRGB` and `false` otherwise.
*/
export declare function isColorRGB(color: any): color is ColorRGB;
/**
* Converts a color of type `ColorRGB` to `ColorRGBA`.
*
* @param color The color to convert.
*
* @return The converted color in rgba format.
*/
export declare function convertRGBToRGBA(rgb: ColorRGB): ColorRGBA;