Format snippets
This commit is contained in:
@ -9,7 +9,8 @@ Converts the values of RGB components to a hexadecimal color code.
|
||||
- Use `String.prototype.padStart(6, '0')` to get a 6-digit hexadecimal value.
|
||||
|
||||
```js
|
||||
const RGBToHex = (r, g, b) => ((r << 16) + (g << 8) + b).toString(16).padStart(6, '0');
|
||||
const RGBToHex = (r, g, b) =>
|
||||
((r << 16) + (g << 8) + b).toString(16).padStart(6, '0');
|
||||
```
|
||||
|
||||
```js
|
||||
|
||||
Reference in New Issue
Block a user