-
Notifications
You must be signed in to change notification settings - Fork 147
feat(Colour): factory method for #RRGGBB color codes
#1487
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
|
Co-authored-by: Zenith <[email protected]> Signed-off-by: Eneg <[email protected]>
I did expect there being a converter for this, but I'm not convinced this simple method is going to be of much use to it. I can see these two relevant methods: disnake/disnake/ext/commands/converter.py Lines 705 to 714 in 9ebc9de
disnake/disnake/ext/commands/converter.py Lines 738 to 757 in 9ebc9de
...but they perform work/validation that goes beyond simply stripping the leading |
Summary
This PR adds a new factory method

.from_hextodisnake.Colourwhich accepts strings in the form of"#RRGGBB".This is particularly useful in code editors that provide a color picker when they detect a color code.
Checklist
uv run nox -s lintuv run nox -s pyright