Deprecate utility tag
This commit is contained in:
@ -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"
|
||||
```
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user