Towards a type safe color option
This commit is contained in:
parent
06aeba9d76
commit
e46adf7dc7
3 changed files with 40 additions and 30 deletions
|
|
@ -3,6 +3,16 @@
|
|||
export const rainbow = "rgba(200,120,120,0.5);"
|
||||
+ "--before-background: linear-gradient(40deg, #FF0000 0%, #00FF00 50%, #0000FF 70%, #FFFF00 100%);";
|
||||
|
||||
export const hex = (hex: string) => hex;
|
||||
|
||||
export const rgb = (r: number, g: number, b: number) => (
|
||||
`rgb(${r.toString()}, ${g.toString()}, ${b.toString()})`
|
||||
);
|
||||
|
||||
export const rgba = (r: number, g: number, b: number, a: number) => (
|
||||
`rgb(${r.toString()}, ${g.toString()}, ${b.toString()}, ${a.toString()})`
|
||||
);
|
||||
|
||||
export const esper_topics = (chip_id: string, name: string) => ({
|
||||
[ `esper_${name}_version` ]: {
|
||||
state: `/service/esper/${chip_id}/info`,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue