dev-classes
Version:
<h3 align="center">SocketApi</h3>
59 lines (57 loc) • 2.39 kB
TypeScript
import { ColorProps } from './Color.types';
export declare class Color {
private static componentToHex;
static rgbToHex: ColorProps['rgbToHex'];
/**
* https://stackoverflow.com/a/54070620/6758968
* r, g, b in [0, 255]
* @returns h in [0,360) and s, v in [0,1]
*/
static rgbToHsv: ColorProps['rgbToHsv'];
/**
* https://stackoverflow.com/a/54024653/6758968
* @param h [0, 360]
* @param s [0, 1]
* @param v [0, 1]
* @returns r, g, b in [0, 255]
*/
static hsvToRgb: ColorProps['hsvToRgb'];
/**
* @returns h [0, 360], s [0, 100], l [0, 100], a [0, 1]
*/
static rgbaToHsla: ColorProps['rgbaToHsla'];
/**
* Converts an HSL color value to RGB. Conversion formula
* adapted from http://en.wikipedia.org/wiki/HSL_color_space.
*
* @param {number} h The hue [0, 360]
* @param {number} s The saturation [0, 1]
* @param {number} l The lightness [0, 1]
* @return {Array} The RGB representation [0, 255]
*/
static hslaToRgba: ColorProps['hslaToRgba'];
static hslaStringToRgba: ColorProps['hslaStringToRgba'];
static hexaToRgba: ColorProps['hexaToRgba'];
static hexaToHsla: ColorProps['hexaToHsla'];
static hexToRgb: ColorProps['hexToRgb'];
static rgbaToHexa: ColorProps['rgbaToHexa'];
static hslaStringToHexa: ColorProps['hslaStringToHexa'];
static hslaStringToHex: ColorProps['hslaStringToHex'];
/**
* @param weight [0, 1]
*/
static mixColors: ColorProps['mixColors'];
static getRgbByTypeBrightness: ColorProps['getRgbByTypeBrightness'];
static getAverageColor: ColorProps['getAverageColor'];
static getAccentColor: ColorProps['getAccentColor'];
static changeColorAccent: ColorProps['changeColorAccent'];
static changeBrightness: ColorProps['changeBrightness'];
static hexBrightness: ColorProps['hexBrightness'];
static getHexColorFromTelegramColor: ColorProps['getHexColorFromTelegramColor'];
static getRgbColorFromTelegramColor: ColorProps['getRgbColorFromTelegramColor'];
static rgbaToRgb: ColorProps['rgbaToRgb'];
static calculateBrightness: ColorProps['calculateBrightness'];
static getTextColor: ColorProps['getTextColor'];
static calculateOpacity: ColorProps['calculateOpacity'];
static clamp: ColorProps['clamp'];
}