update snippets 47-62

This commit is contained in:
Stefan Feješ
2017-12-25 14:16:05 +01:00
parent 7b9ec970e2
commit 16b3984591
15 changed files with 64 additions and 22 deletions

View File

@ -16,8 +16,10 @@ const hexToRGB = hex => {
+ ((h & (alpha ? 0x0000ff00 : 0x0000ff)) >>> (alpha ? 8 : 0))
+ (alpha ? `, ${(h & 0x000000ff)}` : '') + ')';
};
// hexToRGB('#27ae60ff') -> 'rgba(39, 174, 96, 255)'
// hexToRGB('27ae60') -> 'rgb(39, 174, 96)'
// hexToRGB('#fff') -> 'rgb(255, 255, 255)'
```
```js
hexToRGB('#27ae60ff') -> 'rgba(39, 174, 96, 255)'
hexToRGB('27ae60') -> 'rgb(39, 174, 96)'
hexToRGB('#fff') -> 'rgb(255, 255, 255)'
```