add support for enhanced role colors ( gradient and holograpic )#3246
Merged
Conversation
Misha-133
requested changes
Mar 8, 2026
Member
|
Hm, seems like it may indeed be null |
Contributor
Author
|
everything you mentioned is fixed and i hope i did not forget anything else @Misha-133 |
1f9f23a to
ef2d7ab
Compare
ef2d7ab to
0065570
Compare
Member
|
I've gone ahead and made some changes:
|
Misha-133
approved these changes
Mar 11, 2026
kshitijanurag
pushed a commit
to kshitijanurag/Discord.Net
that referenced
this pull request
Mar 20, 2026
…cord-net#3246) * added support for enhanced role colors ( gradient and holograpic ) * colors is nullable not optional * colors object now follows api documentation. * wrapping createroleasync with color param to new with rolecolors param * update RoleColors object and usage --------- Co-authored-by: Quin Lynch <49576606+quinchs@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Until now, roles could only use the legacy
colorfield, which only supports a single solid color. Discord's API exposes acolorsobject on roles, allowing enhanced role color configurations throughprimary_color,secondary_color, andtertiary_color.This changeset introduces a dedicated
RoleColorsvalue type, exposes enhanced colors on role entities, adds support for sending and receiving thecolorspayload in REST and gateway models, and extends role creation/modification APIs in a way that remains backward-compatible with the existingColorAPI.It also handles Discord's special tertiary color requirement: whenever
tertiary_coloris sent, the payload is normalized to Discord's required holographic color triplet.Changes
RoleColorsvalue type to represent enhanced role colors.IRole.Colors.RoleProperties.Colorsso roles can be modified with enhanced colors.IRole.ColorandRoleProperties.Colorbehavior for backward compatibility.CreateRoleAsyncoverloads that acceptRoleColors.colorsobject.colorsobject.RoleColorsentity type.RestRoleandSocketRoleto surface enhanced role colors.EnhancedRoleColorsguild feature and validate it before sending enhanced color payloads.primary_color, matching Discord's API behavior.tertiary_colorto Discord's required holographic values:primary_color = 11127295secondary_color = 16759788tertiary_color = 16761760colorfield when appropriate.colorsobject still expose a compatible single-color representation where possible.