A tool for creating and maintaining cohesive, consistent, and accessible color palettes

Related tags

Color color
Overview

A screenshot of Primer Prism

Primer Prism

Primer Prism is a tool for creating and maintaining cohesive, consistent, and accessible color palettes.

Warning Primer Prism is experimental. Expect bugs and breaking changes as we continue to iterate.

Run locally

# Clone the project
git clone [email protected]:primer/prism.git

# Go to the project directory
cd prism

# Install dependencies
yarn

# Start the development server
yarn start

Prior art

Primer Prism builds on the ideas in many existing color tools:

Comments
  • App crashes when we remove all colors from scale

    App crashes when we remove all colors from scale

    What

    When I create a new palette and remove all colors from scale, I see a blank page

    In Action

    https://user-images.githubusercontent.com/17102399/173680962-4f7fcf31-4840-4fdc-86c3-bba25b766dec.mp4

    P. S.

    What about to add issue template, to let reporters know what they need to provide? 🤔

    opened by pavelkeyzik 11
  • Fix for selected index when switching scale

    Fix for selected index when switching scale

    This PR fixes the issue #19.

    I've updated the code to check if our selected index is greater than our color scale, and if it is, then we just select the last color from the scale, but if we switch back, it will be the same selected color.

    @rafaeltab Could you test it and let me know if everything works as expected? 😊

    opened by pavelkeyzik 7
  • App crashes when a user deletes the selected color using the `-` button

    App crashes when a user deletes the selected color using the `-` button

    Describe the bug App crashes when a user deletes the selected color using the - button

    To Reproduce Steps to reproduce the behavior:

    1. Go to https://primer.style/prism/.
    2. Create a palette.
    3. Select a scale.
    4. Select the last color in the scale.
    5. Click the - button.

    Expected behavior The color that is now the latest after deletion should be selected

    Actual behavior The website presents a completely white screen, and the application throws the following error.

    VM1050 react_devtools_backend.js:4026 Error: Failed to parse color: ""
        at g (parseToRgba.ts:51:3)
        at B (getLuminance.ts:18:21)
        at _ (getContrast.ts:11:22)
        at Be (scale.tsx:497:31)
        at oi (react-dom.production.min.js:157:137)
        at Fi (react-dom.production.min.js:180:154)
        at $u (react-dom.production.min.js:269:343)
        at Tc (react-dom.production.min.js:250:347)
        at jc (react-dom.production.min.js:250:278)
        at kc (react-dom.production.min.js:250:138)
    overrideMethod @ VM1050 react_devtools_backend.js:4026
    uu @ react-dom.production.min.js:216
    a.componentDidCatch.n.callback @ react-dom.production.min.js:217
    da @ react-dom.production.min.js:131
    hu @ react-dom.production.min.js:220
    Cc @ react-dom.production.min.js:259
    t.unstable_runWithPriority @ scheduler.production.min.js:18
    Vo @ react-dom.production.min.js:122
    _c @ react-dom.production.min.js:252
    bc @ react-dom.production.min.js:243
    (anonymous) @ react-dom.production.min.js:123
    t.unstable_runWithPriority @ scheduler.production.min.js:18
    Vo @ react-dom.production.min.js:122
    qo @ react-dom.production.min.js:123
    Ko @ react-dom.production.min.js:122
    Le @ react-dom.production.min.js:292
    Xt @ react-dom.production.min.js:73
    VM1050 react_devtools_backend.js:4026 Error: Failed to parse color: ""
        at g (parseToRgba.ts:51:3)
        at B (getLuminance.ts:18:21)
        at _ (getContrast.ts:11:22)
        at Be (scale.tsx:497:31)
        at oi (react-dom.production.min.js:157:137)
        at Fi (react-dom.production.min.js:180:154)
        at $u (react-dom.production.min.js:269:343)
        at Tc (react-dom.production.min.js:250:347)
        at jc (react-dom.production.min.js:250:278)
        at kc (react-dom.production.min.js:250:138)
    overrideMethod @ VM1050 react_devtools_backend.js:4026
    uu @ react-dom.production.min.js:216
    n.callback @ react-dom.production.min.js:216
    da @ react-dom.production.min.js:131
    hu @ react-dom.production.min.js:220
    Cc @ react-dom.production.min.js:259
    t.unstable_runWithPriority @ scheduler.production.min.js:18
    Vo @ react-dom.production.min.js:122
    _c @ react-dom.production.min.js:252
    bc @ react-dom.production.min.js:243
    (anonymous) @ react-dom.production.min.js:123
    t.unstable_runWithPriority @ scheduler.production.min.js:18
    Vo @ react-dom.production.min.js:122
    qo @ react-dom.production.min.js:123
    Ko @ react-dom.production.min.js:122
    Le @ react-dom.production.min.js:292
    Xt @ react-dom.production.min.js:73
    parseToRgba.ts:51 Uncaught Error: Failed to parse color: ""
        at g (parseToRgba.ts:51:3)
        at B (getLuminance.ts:18:21)
        at _ (getContrast.ts:11:22)
        at Be (scale.tsx:497:31)
        at oi (react-dom.production.min.js:157:137)
        at Fi (react-dom.production.min.js:180:154)
        at $u (react-dom.production.min.js:269:343)
        at Tc (react-dom.production.min.js:250:347)
        at jc (react-dom.production.min.js:250:278)
        at kc (react-dom.production.min.js:250:138)
    g @ parseToRgba.ts:51
    B @ getLuminance.ts:18
    _ @ getContrast.ts:11
    Be @ scale.tsx:497
    oi @ react-dom.production.min.js:157
    Fi @ react-dom.production.min.js:180
    $u @ react-dom.production.min.js:269
    Tc @ react-dom.production.min.js:250
    jc @ react-dom.production.min.js:250
    kc @ react-dom.production.min.js:250
    bc @ react-dom.production.min.js:243
    (anonymous) @ react-dom.production.min.js:123
    t.unstable_runWithPriority @ scheduler.production.min.js:18
    Vo @ react-dom.production.min.js:122
    qo @ react-dom.production.min.js:123
    Ko @ react-dom.production.min.js:122
    Le @ react-dom.production.min.js:292
    Xt @ react-dom.production.min.js:73
    

    This error is very similar to #10, but not completely since in #10 all the colors have to be deleted. Pull request #15 does fix issue #10, but not this one.

    Environment

    • OS: Windows 10 21H1 Build 19043.1766
    • Browser: Chrome 102.0.5005.115
    bug 
    opened by rafaeltab 6
  • adds an index above each scale step

    adds an index above each scale step

    Adds a string above each scale step to indicate which index in the scale.colors array the color is. I opted to wrap the existing scale ZStack in order to separate it from that container (so the points don't interfere with it.

    Screen Shot 2022-06-22 at 8 46 59 PM )

    ref: https://github.com/primer/prism/discussions/32

    opened by bryanberger 4
  • App crashes when an empty scale is opened

    App crashes when an empty scale is opened

    Describe the bug App crashes when an empty scale is opened

    To Reproduce

    1. Create a new palette
    2. Import the following JSON
    {
      "lightgrey": [],
      "dimgrey": [],
      "olivedrab": "#6b8e23"
    }
    
    1. select either the lightgrey or dimgrey scales

    Expected behavior An empty scale should be displayed, it should allow adding a color using the + button. Optionally, the pane on the right could continue to function but without displaying any color settings, just the scale settings.

    P.S. Sorry for not making this issue earlier

    bug 
    opened by rafaeltab 3
  • Blank screen after deleting a scale color

    Blank screen after deleting a scale color

    Describe the bug When I select a scale and delete a color the page goes blank

    To Reproduce Steps to reproduce the behavior:

    1. Go to prism
    2. Create a new palette or go to an existing palette
    3. Select an existing scale or add a new sacle
    4. On the right panel select delete color for the scale (screenshot below)
    image

    Expected behavior Not exactly sure but the page probably shouldn't go blank

    Screenshots image image

    Environment Chrome Version 102.0.5005.115 (Official Build) (x86_64) Mac OS Catalina - Version 10.15.7

    Additional context Posted a video here: https://twitter.com/DamiDina/status/1539291589847171073

    bug 
    opened by damidina 3
  • Add ability to apply easing functions to curves

    Add ability to apply easing functions to curves

    This allows you to apply a bezier easing function any shared curves, as discussed in #16. The endpoints of the existing curve are preserved, and the inner values are fit to the chosen curve.

    opened by stevenpetryk 2
  • Add labels for each color step (index)

    Add labels for each color step (index)

    Screen Shot 2022-06-17 at 8 27 31 AM

    I find myself getting a bit lost in our palettes (we have 20+ steps) highlighting the index value atop each color would be helpful imo. I've got this running locally can get a PR up if interested.

    enhancement 
    opened by bryanberger 2
  • Insert new card mid-palette

    Insert new card mid-palette

    I think it would be nice to insert cards mid-palette. I've had two extent colors that I knew I wanted to use and then fill in the gaps between. Perhaps the '+' could add a new card to the right of whichever card is selected. For example where the arrow is below:

    image

    enhancement 
    opened by curtisbarnard 2
  • Add delete button on the card

    Add delete button on the card

    Screenshot 2022-06-16 at 3 29 46 PM

    Hey there, I was playing around with the codebase. Added the delete button on the card. Let me know what are your views on this. I'd be happy to do a PR.

    enhancement 
    opened by mohitkyadav 2
  • Add code formatter

    Add code formatter

    Hey! I'm interested in drafting some PRs and don't want to nuke the format. Is there a code format that is preferred here that can be added? I assume @github/prettier-config

    opened by bryanberger 2
  • Bump express from 4.17.1 to 4.18.2

    Bump express from 4.17.1 to 4.18.2

    Bumps express from 4.17.1 to 4.18.2.

    Release notes

    Sourced from express's releases.

    4.18.2

    4.18.1

    • Fix hanging on large stack of sync routes

    4.18.0

    ... (truncated)

    Changelog

    Sourced from express's changelog.

    4.18.2 / 2022-10-08

    4.18.1 / 2022-04-29

    • Fix hanging on large stack of sync routes

    4.18.0 / 2022-04-25

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Bump decode-uri-component from 0.2.0 to 0.2.2

    Bump decode-uri-component from 0.2.0 to 0.2.2

    Bumps decode-uri-component from 0.2.0 to 0.2.2.

    Release notes

    Sourced from decode-uri-component's releases.

    v0.2.2

    • Prevent overwriting previously decoded tokens 980e0bf

    https://github.com/SamVerschueren/decode-uri-component/compare/v0.2.1...v0.2.2

    v0.2.1

    • Switch to GitHub workflows 76abc93
    • Fix issue where decode throws - fixes #6 746ca5d
    • Update license (#1) 486d7e2
    • Tidelift tasks a650457
    • Meta tweaks 66e1c28

    https://github.com/SamVerschueren/decode-uri-component/compare/v0.2.0...v0.2.1

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • App crashes when applying linked curves and non-existent values

    App crashes when applying linked curves and non-existent values

    Describe the bug App crashes when applying linked curves and invalid values

    To Reproduce Steps to reproduce the behavior:

    1. Create a curve
    2. Apply it to your color
    3. Adjust curve via input spinner to push curve toward a non-existant value (out of bounds)

    Expected behavior The app doesn't crash, causing me not to reach my color palette anymore. I shouldn't be able to use the spinner to create a non-existant color

    Screenshots (Video) https://user-images.githubusercontent.com/20825047/192326341-56e3fa9b-a3f4-4d92-8de3-706a3e43708c.mp4

    Additional context It seems like there might be a few things at work. App crashes when an invalid hex value is created but it also seems like the linked curves are messing with the input values.

    It would also be nice if I could reach my palettes again. If I attempt to open the color palette that caused the app to crash, it crashes again image

    react 
    opened by IHIutch 0
  • New color is not auto-selected

    New color is not auto-selected

    Describe the bug When adding a color to a scale by clicking the "+" button, the current selected color remains selected, instead of the newly created one. This can be annoying as you start editing the color, only later realizing you were editing one you already made earlier.

    To Reproduce Steps to reproduce the behavior:

    1. Click any scale
    2. Click the "+" button
    3. Notice the color selection remains the same

    Expected behavior Auto-select the latest created color (=latest index).

    Screenshots N/A

    Environment All

    opened by lorenzvanherwaarden 0
Owner
Primer
Components, design guidelines, and tooling for GitHub's design system.
Primer
A CLI utility to calculate/verify accessible magic numbers for a color palette.

A11y Contrast A CLI utility to calculate/verify accessible magic numbers for a color palette. Read my blog post for some more information. Installatio

Darek Kay 23 Nov 13, 2022
Colormath.js - a color conversion and color manipulation library written in typescript for Node.js, Deno and Browser

Colormath.js - a color conversion and color manipulation library written in typescript for Node.js, Deno and Browser

TheSudarsanDev 8 Feb 8, 2022
JavaScript Library for creating random pleasing colors and color schemes

#PleaseJS www.checkman.io/please Please.js is a polite companion that wants to help you make your projects beautiful. It uses HSV color space to creat

Jordan Checkman 2.3k Dec 22, 2022
A simple Discord bot that will listen for HEX, RGB(a), and HSL(a) colors in a message, and provide a small image of that color.

Pigment For the teams of designers and developers out there - Pigment will listen for messages containing a HEX, RGB(a), or HSL(a) color, and provide

Conrad Crawford 17 Dec 8, 2022
:rainbow: Javascript color conversion and manipulation library

color JavaScript library for immutable color conversion and manipulation with support for CSS color strings. var color = Color('#7743CE').alpha(0.5).l

Qix 4.5k Jan 3, 2023
Fast, small color manipulation and conversion for JavaScript

TinyColor JavaScript color tooling TinyColor is a small, fast library for color manipulation and conversion in JavaScript. It allows many forms of inp

Brian Grinstead 4.5k Jan 1, 2023
Color2k - a color parsing and manipulation lib served in roughly 2kB

color2k a color parsing and manipulation lib served in roughly 2kB or less (2.8kB to be more precise) color2k is a color parsing and manipulation libr

Rico Kahler 506 Dec 31, 2022
Create your own complete Web color system fast and easy!

Simpler Color Create your own complete Web color system fast and easy, from as little as one base color! Color is at the heart of every UI design syst

Arnel Enero 278 Dec 20, 2022
A TypeScript package to calculate WCAG 2.0/3.0 and APCA color contrasts

a11y-color-contrast A simple utility package for working with WCAG 2.2/3.0 color contrasts a11y: Built for checking how readable colors are together S

Sondre Aasemoen 10 Oct 10, 2022
JavaScript library for all kinds of color manipulations

Chroma.js Chroma.js is a tiny small-ish zero-dependency JavaScript library (13.5kB) for all kinds of color conversions and color scales. Usage Initiat

Gregor Aisch 9.2k Jan 4, 2023
A simple color picker application written in pure JavaScript, for modern browsers.

Color Picker A simple color picker application written in pure JavaScript, for modern browsers. Has support for touch events. Touchy… touchy… Demo and

Taufik Nurrohman 207 Dec 14, 2022
A dependency-free image color extraction library

Color mage A dependency-free image color extraction library. The extraction consists of using K-Means algorithm. It has a few utility functions as wel

Gilmar Quinelato 4 Mar 11, 2022
A array with color name -> decimal rgbs.

colors-named-decimal A array with color name -> decimal rgbs. Based on https://www.w3.org/TR/css-color-4/#colors-named Installation This package is ES

小弟调调™ 4 Jul 20, 2022
This repo contains resources & practice of project and files , while learning to master JS

Resources to learn JavaScript and conquer the world? Tutorials and Books JavaScript For Cats (http://jsforcats.com/) is a dead simply introduction for

abdulkareem alabi 1 Jan 6, 2022
Tints and shades generator in React.

Reactry's shades goals add option to enter hexColor by hand add option to get hexColor from clipboard add option to set one of the shades or tints as

null 9 May 26, 2022
chakra-radix-colors provides radix-ui color palettes, automatic dark mode, and acessible colors to chakra-ui applications

chakra-radix-colors chakra-radix-colors provides radix-ui color palettes, automatic dark mode, and acessible colors to chakra-ui applications. About C

null 11 Dec 30, 2022
Grupprojekt för kurserna 'Javascript med Ramverk' och 'Agil Utveckling'

JavaScript-med-Ramverk-Laboration-3 Grupprojektet för kurserna Javascript med Ramverk och Agil Utveckling. Utvecklingsguide För information om hur utv

Svante Jonsson IT-Högskolan 3 May 18, 2022
Hemsida för personer i Sverige som kan och vill erbjuda boende till människor på flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 4 May 3, 2022
Kurs-repo för kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

null 14 Jan 3, 2023
Tool Cool Color Picker is a color picker library written in typescript and using web component technologies.

Tool Cool Color Picker Tool Cool Color Picker is a color picker library written in typescript and using web component technologies. Check out the demo

Tool Cool 13 Oct 23, 2022