@mintlify/common
Version:
Commonly shared code within Mintlify
52 lines (51 loc) • 1.99 kB
TypeScript
import { DocsConfig } from '@mintlify/validation';
import { RGBA } from 'color-blend/dist/types.js';
import { RgbaObject } from 'hex-rgb';
type TailwindColorScale = {
'50': string;
'100': string;
'200': string;
'300': string;
'400': string;
'500': string;
'600': string;
'700': string;
'800': string;
'900': string;
'950': string;
};
export type Colors = {
primary: string;
primaryLight: string;
primaryDark: string;
backgroundLight: string;
backgroundDark: string;
bgLightHex: string;
bgDarkHex: string;
anchorDefault: string | undefined;
dropdownDefault: string | undefined;
gray: TailwindColorScale;
};
export declare const hexToRgbString: (hex: string) => string;
export declare const rgbToRgbString: (rgb: RGBA) => string;
export declare const rgbToHex: (rgb: RGBA) => string;
export declare const generateDynamicBackgroundDarkColor: (primaryLight: string, backgroundDark?: string, isHex?: boolean) => string;
export declare const combineColors: (color1: string, color1Opacity: number, color2: string, color2Opacity: number) => RGBA;
export declare const generateDynamicGrayRgb: (primaryRgb: RgbaObject, grayColor: string) => string;
export declare const generateDynamicGrayScale: (primaryColor: string) => TailwindColorScale;
/**
* The function `convertColorsToRgbWithCommas` takes a color string with spaces and converts it to RGB
* format with commas.
* @param {string} color - The `convertColorsToRgbWithCommas` function takes a color string as input
* and converts it to RGB format with commas separating the values. For example, if the input color is
* "255 0 128", the function will return "255, 0, 128".
*/
export declare const convertColorsToRgbWithCommas: (color: string) => string;
export declare function getBackgroundColors(docsConfig?: DocsConfig): {
light: string;
dark: string;
lightHex: string;
darkHex: string;
background: string | undefined;
};
export {};