Deprecate utility tag

This commit is contained in:
Angelos Chalaris
2020-04-16 23:07:33 +03:00
parent 5e42f0aaa4
commit e31aea403d
60 changed files with 118 additions and 117 deletions

View File

@ -1,11 +1,12 @@
---
title: randomHexColorCode
tags: utility,random,beginner
tags: math,random,beginner
---
Generates a random hexadecimal color code.
Use `Math.random` to generate a random 24-bit(6x4bits) hexadecimal number. Use bit shifting and then convert it to an hexadecimal String using `toString(16)`.
Use `Math.random` to generate a random 24-bit(6x4bits) hexadecimal number.
Use bit shifting and then convert it to an hexadecimal String using `toString(16)`.
```js
const randomHexColorCode = () => {
@ -16,4 +17,4 @@ const randomHexColorCode = () => {
```js
randomHexColorCode(); // "#e34155"
```
```