@bitbybit-dev/base
Version:
Bit By Bit Developers Base CAD Library to Program Geometry
115 lines (114 loc) • 3.12 kB
TypeScript
import * as Inputs from "../inputs";
import { MathBitByBit } from "./math";
export declare class Color {
private readonly math;
constructor(math: MathBitByBit);
/**
* Creates a hex color
* @param inputs Color hex
* @returns color string
* @group create
* @shortname color
* @drawable false
*/
hexColor(inputs: Inputs.Color.HexDto): Inputs.Base.Color;
/**
* Creates rgb color from hex
* @param inputs Color hex
* @returns rgb color
* @group convert
* @shortname hex to rgb
* @drawable false
*/
hexToRgb(inputs: Inputs.Color.HexDto): Inputs.Base.ColorRGB;
/**
* Creates hex color from rgb
* @param inputs Color hext
* @returns hex color
* @group convert
* @shortname rgb to hex
* @drawable false
*/
rgbToHex(inputs: Inputs.Color.RGBMinMaxDto): Inputs.Base.Color;
/**
* Creates hex color from rgb obj that contains {r, g, b} properties in certain range
* @param inputs Color hext
* @returns hex color string
* @group convert
* @shortname rgb obj to hex
* @drawable false
*/
rgbObjToHex(inputs: Inputs.Color.RGBObjectMaxDto): Inputs.Base.Color;
/**
* Creates rgb color from hex and maps to different range if needed
* @param inputs Color hext
* @returns rgb color
* @group convert
* @shortname hex to rgb mapped
* @drawable false
*/
hexToRgbMapped(inputs: Inputs.Color.HexDtoMapped): Inputs.Base.ColorRGB;
/**
* Get red param
* @param inputs Color hext
* @returns rgb color
* @group hex to
* @shortname red
* @drawable false
*/
getRedParam(inputs: Inputs.Color.HexDtoMapped): number;
/**
* Get green param
* @param inputs Color hext
* @returns rgb color
* @group hex to
* @shortname green
* @drawable false
*/
getGreenParam(inputs: Inputs.Color.HexDtoMapped): number;
/**
* Get blue param
* @param inputs Color hext
* @returns blue param
* @group hex to
* @shortname blue
* @drawable false
*/
getBlueParam(inputs: Inputs.Color.HexDtoMapped): number;
/**
* RGB to red
* @param inputs Color rgb
* @returns red param
* @group rgb to
* @shortname red
* @drawable false
*/
rgbToRed(inputs: Inputs.Color.RGBObjectDto): number;
/**
* RGB to green
* @param inputs Color rgb
* @returns green param
* @group rgb to
* @shortname green
* @drawable false
*/
rgbToGreen(inputs: Inputs.Color.RGBObjectDto): number;
/**
* RGB to blue
* @param inputs Color rgb
* @returns blue param
* @group rgb to
* @shortname blue
* @drawable false
*/
rgbToBlue(inputs: Inputs.Color.RGBObjectDto): number;
/**
* Invert color
* @param inputs hex color and black and white option
* @returns inverted color
* @group hex to
* @shortname invert color
* @drawable false
*/
invert(inputs: Inputs.Color.InvertHexDto): Inputs.Base.Color;
}