mirror of
https://github.com/danbulant/discord.js
synced 2026-06-08 01:01:30 +00:00
use String#padStart for Role#hexColor (#2294)
This commit is contained in:
parent
8c288b56a2
commit
10f98d8e57
1 changed files with 1 additions and 3 deletions
|
|
@ -95,9 +95,7 @@ class Role extends Base {
|
||||||
* @readonly
|
* @readonly
|
||||||
*/
|
*/
|
||||||
get hexColor() {
|
get hexColor() {
|
||||||
let col = this.color.toString(16);
|
return `#${this.color.toString(16).padStart(6, '0')}`;
|
||||||
while (col.length < 6) col = `0${col}`;
|
|
||||||
return `#${col}`;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue