summaryrefslogtreecommitdiff
path: root/node_modules/rgb-hex/index.d.ts
blob: 2d4a75487324f5ae7e2ddbd00517bdfe9b38fa16 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/**
Convert RGB(A) color to HEX.

@example
```
import rgbHex = require('rgb-hex');

rgbHex(65, 131, 196);
//=> '4183c4'

rgbHex('rgb(40, 42, 54)');
//=> '282a36'

rgbHex(65, 131, 196, 0.2);
//=> '4183c433'

rgbHex(40, 42, 54, '75%');
//=> '282a36bf'

rgbHex('rgba(40, 42, 54, 75%)');
//=> '282a36bf'
```
*/
declare function rgbHex(rgba: string): string;
declare function rgbHex(red: number, green: number, blue: number, alpha?: string | number): string;

export = rgbHex;