Tag and build
This commit is contained in:
12
README.md
12
README.md
@ -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.
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user