Tag and build

This commit is contained in:
Angelos Chalaris
2017-12-15 14:37:51 +02:00
parent 61346bb241
commit 7d874b0862
2 changed files with 13 additions and 0 deletions

View File

@ -104,6 +104,7 @@
### Utility ### Utility
* [Escape regular expression](#escape-regular-expression) * [Escape regular expression](#escape-regular-expression)
* [Get native type of value](#get-native-type-of-value) * [Get native type of value](#get-native-type-of-value)
* [Hexcode to RGB](#hexcode-to-rgb)
* [Is array](#is-array) * [Is array](#is-array)
* [Is boolean](#is-boolean) * [Is boolean](#is-boolean)
* [Is function](#is-function) * [Is function](#is-function)
@ -1136,6 +1137,17 @@ const getType = v =>
[⬆ back to top](#table-of-contents) [⬆ back to top](#table-of-contents)
### Hexcode to RGB
Use `Array.slice()`, `Array.map()` and `match()` to convert a hexadecimal colorcode (prefixed with `#`) to a string with the RGB values.
```js
const hexToRgb = hex => `rgb(${hex.slice(1).match(/.{2}/g).map(x => parseInt(x, 16)).join()})`
// hexToRgb('#27ae60') -> 'rgb(39,174,96)'
```
[⬆ back to top](#table-of-contents)
### Is array ### Is array
Use `Array.isArray()` to check if a value is classified as an array. Use `Array.isArray()` to check if a value is classified as an array.

View File

@ -42,6 +42,7 @@ greatest-common-divisor-(GCD):math
group-by:array group-by:array
hamming-distance:math hamming-distance:math
head-of-list:array head-of-list:array
hexcode-to-RGB:utility
initial-of-list:array initial-of-list:array
initialize-array-with-range:array initialize-array-with-range:array
initialize-array-with-values:array initialize-array-with-values:array