-
Notifications
You must be signed in to change notification settings - Fork 84
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
Auto color scheme generator #3169
Comments
+1 :) |
I'd start tackling this one at a later stage, but will just leave the thought here that we can take huge inspiration from the latest version of the Material Design: https://m3.material.io/styles/color/overview and how they have a tone palette for darker and lighter variants. They seem to work this out is a similar logic as Marius suggests. |
TDLR: the focus here was mainly on generating a Color Palette, using 2 different approaches (I attached the files for each example). We can extend this in future with a HUE customisable slider by users. The idea behind this is to use HSL when generating color paletts, and the generator will act as an extension for the Color System in Neve (maybe TPC in future as a Stylekit Generator). Below a Figma prototype, how this could work in the initial version: Screen.Recording.2023-01-25.at.11.05.25.movRandomly generated colorsUsing this approach, the color pallets are generated (almost) randomly, with some adjustment for the range of the values - to make sure a color is always dark or light. Screen.Recording.2023-01-25.at.11.25.55.movAccent based color paletteThe second example is based on this idea from a Google UI challenge, and what it does is generating 3 palettes (dark, light, dim) where the palette is generated based on the main accent color. Adjusting the HUE of the main color, will also influence the other colors in the palette. To test this, use this zip, and inside the dist folder use the template or index files, and press Space in browser to generate palettes. Going forwardPersonally I prefer the second approach, as it's less random. In terms of integration, we can initially ask users if they think this is useful, and we can add this in the Color System panel (maybe later in the import wizard). It's also possible to add this as a HUE slider for the accent color, meaning that if the user changes the hue in the color picker -> the colors would adjust. But only using HUE and HSL, because otherwise the CSS formulas that create other colors, won't work as expected. Another challenge is the fact that using the whole color picker, it's challenging to generate the palette, in cases where a user chooses a #000000 button. Contrast Ratio Let me know your thoughts, when you have some time, no rush at all. |
Hi there, @mghenciu! Thank you for all your research and for trying to give this Idea a shape. To be honest, the idea of having this random doesn't sound too good and I would avoid it at all costs. Every user has some branding colors. Suggesting a randomly generated color wouldn't make this feature that useful. What I would do is after the user selects "generate palette automatically" allow the user to select just the primary color of his site and generate the rest of the colors based on that, something like this: https://vertis.d.pr/v/fpz5V6 The button from your video that regenerates colors can randomly pick not the main colors but the rules that other colors are generated. We will have the base color but the secondary color will be the base color + a random luminosity between a range that we established. And every time you click regenerate, it will be another variation but from the base color. Here's the code I've used: :root {
--primary-h: 100;
--primary-s: 94%;
--primary-l: 43%;
--nv-primary-accent: hsl( var(--primary-h), var(--primary-s), var(--primary-l))!important;
--nv-secondary-accent: hsl( var(--primary-h), var(--primary-s), calc( (var(--primary-l) * 0) + 35% ))!important;
--nv-site-bg: hsl( var(--primary-h), var(--primary-s), calc( (var(--primary-l) * 0) + 95% ))!important;
--nv-light-bg: hsl( var(--primary-h), var(--primary-s), calc( (var(--primary-l) * 0) + 50% ))!important;;
--nv-dark-bg: #14171c;
--nv-text-color: #393939;
--nv-text-dark-bg: #ffffff;
--nv-c-1: #77b978;
--nv-c-2: #f37262;
} The challenging part is to actually find a formula for secondary-accent, site-bg, light-bg, dark-bg etc. Let me know your thoughts. |
Yes, you are probably right @cristian-ungureanu . But in a real case, you are right - probably users have a Brand color already (or at least an idea about it).
maybe also a Regenerate option, which will try to find different palettes using the same brand color. The Oxygen builder example, this one, Automatic CSS - are using a similar approach, where users have to choose a brand color. Thank you 🚀 |
I subscribed to this thread because I had a need to create color palettes for like 6 websites that need to match a corporate branding. IMHO this would be an awesome feature for users who are not trying to find a good look but need to comply to a branding guide. On a sidenote and a bit off topic: While trying to set up the palettes I found that, in practice, it is difficult for me to distinguish between usage of primary and secondary color. Often there seems to be something hurtful to the eye when trying to set a secondary color that is for example on the opposite side of the hue wheel. |
Description:
This is just for brainstorming right now but I think it's a topic that is worth exploring in order to offer more flexibility for colors with less work for site creators.
The challenge is if we can restrict this to only 4 colors and use HSL manipulation to extend to more of them but using the same baseline colors:
I.e: we would use 4 colors for Primary/Secondary/Accent and Base and each one will have automatically generated 4 shades as light, ultra-light, dark, ultra-dark as well as some transparency variations let's say 20%, 40%, 60%, 80%, and a complementary color. Basically, each one of those Individual colors will generate additionally 9 more color variants but they will be controlled from the same base color.
I.e if I use the color variant of Ultra Light - Primary somewhere and I change the Primary, the Ultra Light will change automatically too.
Let me know your thoughts @Codeinwp/design-team @abaicus
References:
Figma
The text was updated successfully, but these errors were encountered: