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

feat: color theory based theme generator #1925

Closed

Conversation

ak4zh
Copy link
Contributor

@ak4zh ak4zh commented Aug 23, 2023

Linked Issue

Closes: None currently

Description

This pull request introduces a new feature that allows users to generate theme colors based on various color theories. The feature adds a dropdown selector that lets users choose a color theory, and then generates a color palette following that theory.

Changes

  • Added a dropdown selector to the color generation section.
  • Integrated color theory functions to generate theme colors based on the selected theory.
  • Created functions for generating colors using various color theories, including Random, Complementary, Analogous, Triadic, Split-Complementary, Tetradic, Monochromatic, Neutral with Accents, Pastel, and High Contrast.

Purpose

The purpose of this pull request is to discuss the proposed feature and gather feedback from the community. Users will be able to experiment with different color theories and generate theme colors that match their preferences and needs.

Next Steps

This is a draft pull request, and I'm looking forward to receiving feedback on the feature implementation and user experience. Once the feedback is collected and addressed, we can move forward with refining the feature and ensuring it aligns well with the goals of the project.

Please feel free to share your thoughts and suggestions on this proposed feature. Your feedback is highly appreciated!

This PR is a work-in-progress and is being submitted as a draft for discussion and feedback.

Changsets

Instructions: Changesets automate our changelog. If you modify files in /packages/skeleton, run pnpm changeset in the root of the monorepo, follow the prompts, then commit the markdown file. Changes that add features should be minor while chores and bugfixes should be patch. Please prefix the changeset message with feat:, bugfix: or chore:.

Checklist

Please read and apply all contribution requirements.

  • This PR targets the dev branch (NEVER master)
  • Documentation reflects all relevant changes
  • Branch is prefixed with: docs/, feat/, chore/, bugfix/
  • Ensure Svelte and Typescript linting is current - run pnpm check
  • Ensure Prettier linting is current - run pnpm format
  • All test cases are passing - run pnpm test
  • Includes a changeset (if relevant; see above)

@changeset-bot
Copy link

changeset-bot bot commented Aug 23, 2023

⚠️ No Changeset found

Latest commit: 3047149

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link

vercel bot commented Aug 23, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
skeleton-docs ✅ Ready (Inspect) Visit Preview Aug 23, 2023 4:23am

@niktek
Copy link
Contributor

niktek commented Aug 23, 2023

Hey @ak4zh ,

I'd be curious to know how the different color theories would work with the base design tokens (primary, secondary, tertiary, etc) and hence how they get consumed into the components themselves. For instance monochromatic is already kind of implicit in the shades of each color token, but clearly would need to be consumed differently in the components or force end devs to override defaults of secondary and tertiary uses to use the shades from Primary to achieve a monochromatic theory.

Also, I know it's a draft, but the v2 branch is disappearing in less than a week, when it gets merged to dev+master. I think it might be best to raise an actual discussion first because there are a lot of implications and approaches to this that need to be fleshed out before actual code implementation. For that discussion it would be great to see something like example palettes of each theory, what tokens they would map to, how they would be consumed/reflected by components. Then we can look at whether it would have any effect on color checking, theme data formats etc.

Cheers,
Nik

@ak4zh
Copy link
Contributor Author

ak4zh commented Aug 23, 2023

@niktek I will go ahead and create a discussion, thanks for pointing that out. Also I understand the v2 branch will vanish in a few days, I wouldn’t mind opening a new pull request with dev as the base branch.

I just created this draft pull request to have a live version so we can play around with it for discussion. I am not very good with colours selections and the current random generator does not generate any usable set of colours as it’s truly random.

I was just playing around with these settings and it seemed to generator some sensible colour combinations compared to truly random ones which can be used right away or can be further customised. So wanted to have something up for others to play around.

@endigo9740
Copy link
Contributor

endigo9740 commented Aug 23, 2023

Discussion should go here please. We have a LOT of changes planned and this will need to come as a focused update rather than piecemeal:

@ak4zh
Copy link
Contributor Author

ak4zh commented Aug 23, 2023

@niktek To answer the other part about design token, I was thinking of ways to specify a near colour for each design token color. For example we can mention that the error color should be near red color but should one that syncs well with the selected color theory generated colors.

I am still thinking of how to achieve that but just shared because this does generates something better than random, and others who actually made this theme generator can help me with their inputs.

@niktek niktek mentioned this pull request Aug 23, 2023
32 tasks
@niktek
Copy link
Contributor

niktek commented Aug 23, 2023

Yep I'm seeing some situations where the randomisation appears better on the palette on screen case, but don't really flow through to how they would show up when consumed by the components themselves and then of course there are just some examples where they are all competing for darkness!

image

I've added your PR to the list already going in the issue @endigo9740 linked above so we can weigh all the changes together.

@ak4zh
Copy link
Contributor Author

ak4zh commented Aug 23, 2023

@niktek Yes I see Monochromatic, Neutral and Pastel does not generate good options as it follows a light to dark variation, which we already have in design system.
The rest of the theories does generates somewhat usable colors.

@endigo9740
Copy link
Contributor

endigo9740 commented Aug 23, 2023

The issue with this PR is that it's working being completed in a place that this feature will no longer be maintained soon. Essentially whatever is happening between now and the v2 release next week, and then we'll hit a feature freeze until the standalone version is created.

Given that, we have this PR as reference, but will not be moving forward with it.

@endigo9740 endigo9740 closed this Aug 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants