question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow for different shades of colors

See original GitHub issue

Hey all, love the library. Super simple and intuitive to get started with.

I’d love to have the option to select a specific shade of a color from the Tailwind palette (e.g. blue-700), which would be useful for cases like a chart using multiple shades of a color:

image

Something like this:

<BarChart
  data={...}
  categories={['First', 'Second', 'Third', 'Fourth']}
  dataKey="month"
  colors={['blue-700', 'blue-600', 'blue-500', 'blue-400']}
  stack={true}
/>

Is this something you’d consider adding?

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
michaelhayscommented, Oct 10, 2022

Awesome, thanks! And yes I definitely understand the desire to keep things opinionated, and that even in this seemingly simple case there are plenty of things to consider when approaching the implementation (for one, the best way to allow for each shade without oversaturating the TypeScript suggestions with all of blue-100, blue-200, etc, or if this is even a problem at all).

For my use case, we’re using the Tailwind color palette for our branding, but are primarily using blue-700 as our brand color, with some orange-600 accents in small places. Using other Tailwind colors in our charts isn’t awful, but it definitely clashes with the rest of the UI a bit.

I do wonder if an “escape hatch” for arbitrary color customization might be the best way to provide this type of flexibility (since I imagine that’ll be a common request in the future), while still highly recommending the default Tailwind color palette, to take advantage of things like the automatic shade adjustment that you mention in your color palette docs. Just a thought, obviously there’s always a trade-off!

1reaction
michaelhayscommented, Oct 10, 2022

Of course! Happy to help in any way I can

Read more comments on GitHub >

github_iconTop Results From Across the Web

+12 Shades of Color with Hex Codes - Eggradients.com
From light blue to dark red, you can find 50 shades of 11 colors on this page. Different shades of similar colors are...
Read more >
Colors in English: 90 Dreamy Shades from Mint Green to Mango
From shades of green to hues of yellow, this dazzling and delicious color palette guide for learning English colors is a must.
Read more >
Color Theory 101: A Complete Guide to Color Wheels & Color ...
Consider this your introductory course to color theory, types of color ... The various "shades" just refer to how much black you're adding....
Read more >
Different shades of perception
Color categories make the world easier to live in. Granny Smith (green) and Red Delicious (red) apples belong in different bins; so do...
Read more >
Improve Your Vocabulary: 50+ Shades of Colors in English!
You already know your basic colors in English, now let's take them to the next l ... They're different shades of red, but...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found