8000 feat: add signed & unsigned integer colour repr by backwardspy · Pull Request #27 · catppuccin/whiskers · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat: add signed & unsigned integer colour repr #27

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

Merged
merged 3 commits into from
Sep 8, 2024
Merged

Conversation

backwardspy
Copy link
Member
@backwardspy backwardspy commented Jul 2, 2024

todo:

  • naming
  • tests
  • docs

@backwardspy backwardspy added the enhancement New feature or request label Jul 2, 2024
@backwardspy backwardspy self-assigned this Jul 2, 2024
@uncenter
Copy link
Member
uncenter commented Jul 2, 2024

Naming seems good to me btw :)

@NeonGamerBot-QK
Copy link
Member

any updates on this?

@backwardspy
Copy link
Member Author

any updates on this?

i forgot about it amongst a bunch of recent irl stuff. thanks for bring it back to my attention! i'll see if i can get it sorted today.

@uncenter
Copy link
Member
uncenter commented Sep 8, 2024

Feels weird adding this onto the color object itself (original palette data doesn't include this, can be generated via information on the color object already), I would think a filter would be better. 🤔

EDIT: Tested and works great for Aliucord. Still think it should be a filter though :D

@backwardspy
Copy link
Member Author
backwardspy commented Sep 8, 2024

the whiskers models are not directly related to the palette json, so i'm not averse to adding new fields for whiskers. we also tend to use fields for, for lack of a better term, simple or obvious (edit: let's say intrinsic) formats of the colours (hex, rgb), and filters/functions for things that need to be chained or at least require more work to calculate. i readily admit that it's a pretty fuzzy boundary, though.

that said, i did try a filter for this initially but i didn't find a design i liked that wasn't also cumbersome to use. i also considered just having a single int field that was tied to the hex format for component order/inclusion, but that felt too unintuitive.

i settled on the idea of having these three fields that i feel to be the most common formats for now, then in future we could also add a filter for cases where you need more customisation and don't mind the extra overhead of having to use a filter for it. something like {{red | intrep(bits=32, order="rgba")}} for example.

let me know how you'd like to see it as a filter, and the advantages it'd offer.

@uncenter
Copy link
Member
uncenter commented Sep 8, 2024

Well I was thinking having a filter for each type of repr, so {{ red | sint32 }} instead of {{ red.sint32 }}, and so on. I thought this was the design of the API when first testing it out in Aliucord but I had to take a look at this PR's code to understand. This feels similar to the css_rgb-type functions, where you can format the existing RGB data into the CSS format. In this case, you can format the same existing RGB data into this different format.

@backwardspy
Copy link
Member Author

i see it more like the hex format - an exact identical/lossless representation of those RGB channels.

@uncenter
Copy link
Member
uncenter commented Sep 8, 2024

Sure, whatever you are good with. Anything else left for this PR? Docs... fun.

@backwardspy
Copy link
Member Author

think so yeah, i'll update those when i get back and get this moving 👍 thanks for the input!

@backwardspy backwardspy merged commit 6d2f354 into main Sep 8, 2024
6 checks passed
@backwardspy backwardspy deleted the feat/intrep branch September 8, 2024 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0