Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F100969946
createPalette.d.ts
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Tue, Feb 4, 10:09
Size
2 KB
Mime Type
text/x-java
Expires
Thu, Feb 6, 10:09 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
24066512
Attached To
rOACCT Open Access Compliance Check Tool (OACCT)
createPalette.d.ts
View Options
import { Color, PaletteMode } from '..';
export {};
// use standalone interface over typeof colors/commons
// to enable module augmentation
export interface CommonColors {
black: string;
white: string;
}
export type ColorPartial = Partial<Color>;
export interface TypeText {
primary: string;
secondary: string;
disabled: string;
}
export interface TypeAction {
active: string;
hover: string;
hoverOpacity: number;
selected: string;
selectedOpacity: number;
disabled: string;
disabledOpacity: number;
disabledBackground: string;
focus: string;
focusOpacity: number;
activatedOpacity: number;
}
export interface TypeBackground {
default: string;
paper: string;
}
export type TypeDivider = string;
export type PaletteColorOptions = SimplePaletteColorOptions | ColorPartial;
export interface SimplePaletteColorOptions {
light?: string;
main: string;
dark?: string;
contrastText?: string;
}
export interface PaletteColor {
light: string;
main: string;
dark: string;
contrastText: string;
}
export interface TypeObject {
text: TypeText;
action: TypeAction;
divider: TypeDivider;
background: TypeBackground;
}
export type PaletteTonalOffset =
| number
| {
light: number;
dark: number;
};
export const light: TypeObject;
export const dark: TypeObject;
export interface PaletteAugmentColorOptions {
color: PaletteColorOptions;
mainShade?: number | string;
lightShade?: number | string;
darkShade?: number | string;
name?: number | string;
}
export interface Palette {
common: CommonColors;
mode: PaletteMode;
contrastThreshold: number;
tonalOffset: PaletteTonalOffset;
primary: PaletteColor;
secondary: PaletteColor;
error: PaletteColor;
warning: PaletteColor;
info: PaletteColor;
success: PaletteColor;
grey: Color;
text: TypeText;
divider: TypeDivider;
action: TypeAction;
background: TypeBackground;
getContrastText: (background: string) => string;
augmentColor: (options: PaletteAugmentColorOptions) => PaletteColor;
}
export interface Channels {
mainChannel: string;
lightChannel: string;
darkChannel: string;
contrastTextChannel: string;
}
export type PartialTypeObject = { [P in keyof TypeObject]?: Partial<TypeObject[P]> };
export interface PaletteOptions {
primary?: PaletteColorOptions;
secondary?: PaletteColorOptions;
error?: PaletteColorOptions;
warning?: PaletteColorOptions;
info?: PaletteColorOptions;
success?: PaletteColorOptions;
mode?: PaletteMode;
tonalOffset?: PaletteTonalOffset;
contrastThreshold?: number;
common?: Partial<CommonColors>;
grey?: ColorPartial;
text?: Partial<TypeText>;
divider?: string;
action?: Partial<TypeAction>;
background?: Partial<TypeBackground>;
getContrastText?: (background: string) => string;
}
export default function createPalette(palette: PaletteOptions): Palette;
Event Timeline
Log In to Comment