kLabz / haxe-material-ui

Haxe externs and tools for material-ui
MIT License
9 stars 5 forks source link

Styles API #3

Open kLabz opened 4 years ago

kLabz commented 4 years ago

From https://github.com/mui-org/material-ui/blob/master/packages/material-ui-styles/src/index.d.ts

kLabz commented 4 years ago

Will need proper jss externs See https://github.com/cssinjs/jss/blob/master/packages/jss/src/index.d.ts for types

kLabz commented 3 years ago

Edit:

From @material-ui/core/styles/colorManipulator.d.ts, actually:

export type ColorFormat = 'rgb' | 'rgba' | 'hsl' | 'hsla';
export interface ColorObject {
  type: ColorFormat;
  values: [number, number, number] | [number, number, number, number];
}

export function hexToRgb(hex: string): string;
export function rgbToHex(color: string): string;
export function hslToRgb(color: string): string;
export function decomposeColor(color: string): ColorObject;
export function recomposeColor(color: ColorObject): string;
export function getContrastRatio(foreground: string, background: string): number;
export function getLuminance(color: string): number;
export function emphasize(color: string, coefficient?: number): string;
export function fade(color: string, value: number): string;
export function darken(color: string, coefficient?: number): string;
export function lighten(color: string, coefficient?: number): string;