mirror of
https://github.com/plankanban/planka.git
synced 2026-02-25 03:14:50 +03:00
Colour names to HEX conversion #633
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @madduck on GitHub (Jan 20, 2025).
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
@hwelch-fle commented on GitHub (Jan 20, 2025):
Since you're using
plankapy, here's some literals from thev2re-write you can use for now: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.
@madduck commented on GitHub (Jan 21, 2025):
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.
@hwelch-fle commented on GitHub (Jan 21, 2025):
@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.
@madduck commented on GitHub (Jan 21, 2025):
@hwelch-fle they are only defined in the SCSS files...
@hwelch-fle commented on GitHub (Jan 21, 2025):
Heres the commit with the mappings added. Labels are just hexcodes while the Gradients are strings of CSS code for generating the gradient.
@madduck commented on GitHub (Jan 21, 2025):
Very cool, thank you. When Planka exposes this in an API, then you can hopefully drop this hard-coded weight.
@hwelch-fle commented on GitHub (Jan 21, 2025):
Definitely check out
v2if you get the chance, I definitely need some feedback on it. Been testing async and it seems to work for the most part, but you have to write your async functions yourself as each interface is just a container for route generators. Got some quick and dirty examples in thetestsmodule.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).
@madduck commented on GitHub (Jan 21, 2025):
@hwelch-fle are you on IRC or Matrix where we can discuss? I wrote some thoughts into https://github.com/hwelch-fle/plankapy/pull/9 but Github PRs and issues aren't really the right forum to get started.