-
-
Notifications
You must be signed in to change notification settings - Fork 818
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
Colour names to HEX conversion #999
Comments
Since you're using LabelColor = Literal[
'berry-red',
'pumpkin-orange',
'lagoon-blue',
'pink-tulip',
'light-mud',
'orange-peel',
'bright-moss',
'antique-blue',
'dark-granite',
'lagune-blue',
'sunny-grass',
'morning-sky',
'light-orange',
'midnight-blue',
'tank-green',
'gun-metal',
'wet-moss',
'red-burgundy',
'light-concrete',
'apricot-red',
'desert-sand',
'navy-blue',
'egg-yellow',
'coral-green',
'light-cocoa',
]
Gradient = Literal[
'old-lime',
'ocean-dive',
'tzepesch-style',
'jungle-mesh',
'strawberry-dust',
'purple-rose',
'sun-scream',
'warm-rust',
'sky-change',
'green-eyes',
'blue-xchange',
'blood-orange',
'sour-peel',
'green-ninja',
'algae-green',
'coral-reef',
'steel-grey',
'heat-waves',
'velvet-lounge',
'purple-rain',
'blue-steel',
'blueish-curve',
'prism-light',
'green-mist',
'red-curtain',
] I agree that these color names are a bit silly and they should be using a standard CSS color library or raw HEX codes. maintaining these color lists is a manual process for now unless an endpoint is created to pull registered colors and gradients. |
I saw your lists @hwelch-fle, but they don't have the hex colours. So if I implement my own UI, I have to hard-code the colours there. |
@madduck I can't even seem to find the HEX codes in the planka repo, If you share them, I'll add them to the plankapy project for easy conversion. |
@hwelch-fle they are only defined in the SCSS files... |
Heres the commit with the mappings added. Labels are just hexcodes while the Gradients are strings of CSS code for generating the gradient. |
Very cool, thank you. When Planka exposes this in an API, then you can hopefully drop this hard-coded weight. |
Definitely check out Next order of business is to build tests and docs now that it works (and a lot faster than v1 in my testing, was able to make 100 cards in about 1 second using an async for loop). |
@hwelch-fle are you on IRC or Matrix where we can discuss? I wrote some thoughts into hwelch-fle/plankapy#9 but Github PRs and issues aren't really the right forum to get started. |
Hello,
Colours like
berry-red
, as used by Planka, are not standard. I am trying to do some work via the API, and it would be really good to have an endpoint where I can obtain the list of colours and their HEX representations.It seems that the code might also benefit from this, as currently, the list of colour names and their CSS HEX codes are defined in separate places.
Thank you,
Martin
The text was updated successfully, but these errors were encountered: