Skip to content

What should the color value be if there were slate-150 and gray-150? #13284

Answered by maxlshk
GorvGoyl asked this question in Help
Discussion options

You must be logged in to vote

Hey @GorvGoyl !

The values for colors like gray-150 or slate-150 can be easily calculated through present values of 100 and 200 using JS:

slate_100_rgb = (241, 245, 249)
slate_200_rgb = (226, 232, 240)

gray_100_rgb = (243, 244, 246)
gray_200_rgb = (229, 231, 235)

slate_150_rgb = tuple((a + b) // 2 for a, b in zip(slate_100_rgb, slate_200_rgb))
gray_150_rgb = tuple((a + b) // 2 for a, b in zip(gray_100_rgb, gray_200_rgb))

And then converted to hex:

def rgb_to_hex(rgb):
    return '#' + ''.join(f'{value:02x}' for value in rgb)

Tailwind Play example: https://play.tailwindcss.com/h79sVmFZPz

Check the config tab for the values 🤓

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@GorvGoyl
Comment options

Answer selected by GorvGoyl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants