Skip to content

Commit 7fbb3e3

Browse files
authored
feat: role gradient colors (#1281)
1 parent ef1f32a commit 7fbb3e3

File tree

12 files changed

+176
-0
lines changed

12 files changed

+176
-0
lines changed

deno/payloads/v10/guild.ts

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

deno/payloads/v10/permissions.ts

Lines changed: 26 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

deno/payloads/v9/guild.ts

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

deno/payloads/v9/permissions.ts

Lines changed: 26 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

deno/rest/v10/guild.ts

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

deno/rest/v9/guild.ts

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

payloads/v10/guild.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -565,6 +565,10 @@ export enum GuildFeature {
565565
* Guild has enabled the welcome screen
566566
*/
567567
WelcomeScreenEnabled = 'WELCOME_SCREEN_ENABLED',
568+
/**
569+
* Guild is able to set gradient colors to roles
570+
*/
571+
EnhancedRoleColors = 'ENHANCED_ROLE_COLORS',
568572
}
569573

570574
/**

payloads/v10/permissions.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,14 @@ export interface APIRole {
1818
name: string;
1919
/**
2020
* Integer representation of hexadecimal color code
21+
*
22+
* @remarks `color` will still be returned by the API, but using the `colors` field is recommended when doing requests.
2123
*/
2224
color: number;
25+
/**
26+
* The role's colors
27+
*/
28+
colors?: APIRoleColors;
2329
/**
2430
* If this role is pinned in the user listing
2531
*/
@@ -99,3 +105,23 @@ export enum RoleFlags {
99105
*/
100106
InPrompt = 1 << 0,
101107
}
108+
109+
/**
110+
* @see {@link https://discord.com/developers/docs/topics/permissions#role-colors-object}
111+
*/
112+
export interface APIRoleColors {
113+
/**
114+
* The primary color for the role
115+
*/
116+
primary_color: number;
117+
/**
118+
* The secondary color for the role, this will make the role a gradient between the other provided colors
119+
*/
120+
secondary_color: number | null;
121+
/**
122+
* The tertiary color for the role, this will turn the gradient into a holographic style
123+
*
124+
* @remarks When sending `tertiary_color` the API enforces the role color to be a holographic style with values of `primary_color = 11127295`, `secondary_color = 16759788`, and `tertiary_color = 16761760`.
125+
*/
126+
tertiary_color: number | null;
127+
}

payloads/v9/guild.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -557,6 +557,10 @@ export enum GuildFeature {
557557
* Guild has enabled the welcome screen
558558
*/
559559
WelcomeScreenEnabled = 'WELCOME_SCREEN_ENABLED',
560+
/**
561+
* Guild is able to set gradient colors to roles
562+
*/
563+
EnhancedRoleColors = 'ENHANCED_ROLE_COLORS',
560564
}
561565

562566
/**

payloads/v9/permissions.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,14 @@ export interface APIRole {
1818
name: string;
1919
/**
2020
* Integer representation of hexadecimal color code
21+
*
22+
* @remarks `color` will still be returned by the API, but using the `colors` field is recommended when doing requests.
2123
*/
2224
color: number;
25+
/**
26+
* The role's colors
27+
*/
28+
colors?: APIRoleColors;
2329
/**
2430
* If this role is pinned in the user listing
2531
*/
@@ -99,3 +105,23 @@ export enum RoleFlags {
99105
*/
100106
InPrompt = 1 << 0,
101107
}
108+
109+
/**
110+
* @see {@link https://discord.com/developers/docs/topics/permissions#role-colors-object}
111+
*/
112+
export interface APIRoleColors {
113+
/**
114+
* The primary color for the role
115+
*/
116+
primary_color: number;
117+
/**
118+
* The secondary color for the role, this will make the role a gradient between the other provided colors
119+
*/
120+
secondary_color: number | null;
121+
/**
122+
* The tertiary color for the role, this will turn the gradient into a holographic style
123+
*
124+
* @remarks When sending `tertiary_color` the API enforces the role color to be a holographic style with values of `primary_color = 11127295`, `secondary_color = 16759788`, and `tertiary_color = 16761760`.
125+
*/
126+
tertiary_color: number | null;
127+
}

0 commit comments

Comments
 (0)