@vuesax-alpha/nightly
Version:
A Component Library for Vue 3
35 lines (34 loc) • 1.53 kB
TypeScript
import type { MaybeRef } from './typescript';
export declare const getCssVariable: (el: HTMLElement, property: string) => string;
export declare const isColorDark: (color?: string | boolean | undefined) => boolean;
export declare const isVsColor: (color: string) => boolean;
/**
* #eee -> length hex shorthand, shorthand with alpha, classic, hex alpha
*/
export declare const isHexColor: (color: string) => boolean;
export declare const isRgbColor: (color: string) => boolean;
export declare const isRGBNumbers: (color: string) => boolean;
export declare const hexToRgb: (color: string) => {
r: number;
g: number;
b: number;
} | null;
export declare const setColor: (colorName: string, color: string, el: HTMLElement, addClass?: boolean | undefined, namespace?: string) => void;
/**
* accept Vuesax's color, hex color, rgb color
* @param color string
*/
export declare const acceptColor: (color: string) => boolean;
/**
* Convert color to rgb number, accept Vuesax's color, hex color, rgb color
*
* e.g 'rgb(23,34,34)' -> '23, 34, 34'
*/
export declare const getVsColor: (colorRef: MaybeRef<string | undefined>, namespace?: string) => string;
/**
* @param propertyName The name of the property
* @param value The value of the property
* @param el The element to set the property. Default document.documentElement
* @param namespace The namespace of vs app. Default'vs'
*/
export declare const setCssVar: (propertyName: string, value: string, el?: HTMLElement | undefined, namespace?: string) => void;