mirror of
https://github.com/danbulant/discord.js
synced 2026-05-27 14:02:02 +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
|
||||
*/
|
||||
get hexColor() {
|
||||
let col = this.color.toString(16);
|
||||
while (col.length < 6) col = `0${col}`;
|
||||
return `#${col}`;
|
||||
return `#${this.color.toString(16).padStart(6, '0')}`;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue