Skip to content
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

Color manipulation methods #2136

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

Be1zebub
Copy link
Contributor

Features:
HWB support.
Color manipulation methods with HSV, HSL, HSB, HWB.

The main way to use this methods is to create colors for the UI.
For example, the Discord color scheme consists of the same hue and saturation, they just change lightness to create a beautiful color palette.

All you need to make pallete is background color, text color & accent color.
So addons theme config can be just 3-5 colors, instead of:
image

Demo:

hl2_ga8aLyIIvR.mp4

demo src: https://gist.github.com/Be1zebub/a015958b71eb8806f0ce5db3e55ed4c0

Add color manipulation functions with HSV, HSL, HSB, HWB.
Add HWB support.
@robotboy655 robotboy655 added the Addition The pull request adds new functionality. label Oct 14, 2024
@robotboy655
Copy link
Collaborator

robotboy655 commented Jan 21, 2025

Do you think it's also worth porting HSVToColor and HSLToColor to Lua? Not sure how the performance would differ, but it would solve Facepunch/garrysmod-issues#2407

Also there are conflicts that must be resolved.

@Be1zebub
Copy link
Contributor Author

Be1zebub commented Jan 21, 2025

is this legit? lua implementation 100500% faster
hsl2color is same results
image
https://gist.github.com/Be1zebub/e069b63ca4b96d16ed99fd77af2ae9aa

fix style, rm :SetValue alias, add HSLToColor & HSVToColor lua implementation (100500x faster than C)
@Be1zebub
Copy link
Contributor Author

ready 2 merge
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Addition The pull request adds new functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants