mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-16 19:43:29 +01:00
use String#padStart for Role#hexColor (#2294)
This commit is contained in:
@@ -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}`;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user