Tutorial: Creating Penpot color palettes and libraries

Learn how to use color and save reusable colors for your design system with Penpot’s color palette and shared libraries.

Tutorial: Creating Penpot color palettes and libraries

Color is one of my favorite topics. It has so much power to aid usability and set the mood and tone of a design.

Watch my live hands-on demo of color palettes and libraries with questions from the community.

In Penpot, you can save color values in your file’s local library and reuse these values across your design. You can also publish your local library as a shared library for your team to use across other projects. Once you’ve saved a color and used it for multiple items, you can also update the value to update it across your design.

Penpot’s versatile color picker

In Penpot you apply color as either a fill that fills the object or a stroke that outlines the object. Once you’ve added a fill or stroke, you can enter your color as a hex color code or use the color picker to grab or refine the color you want.

You can open the color picker by clicking the fill or stroke’s swatch (square of color). The eyedropper tool in the top left corner of the color picker helps you grab a color from anywhere in your design. 

0:00
/0:11

You can also use the eyedropper to pick a color from an image you’ve imported.

You can use the spectrums, sliders, and individual values inside the color picker to refine your fill or stroke color. There are three options tabs inside the color picker: RGB, Harmony, and HSV. In each tab you can also use the eyedropper, access colors already stored in your file library or shared libraries, or enter the color code as RGB(A) and hex values.

The default color picker showing a spectrum with shades of dusty blue and sliders for hue and transparency.
The default RGB color picker gives you a spectrum of shades in the currently selected hue, a hue slider, and an alpha slider to control the transparency of your fill or stroke color.
Harmony color picker showing a spectrum with pickers for the current purple color and the opposite green yellow color.
The Harmony color picker offers a color wheel with your currently selected color and the complementary (opposite) color to help you choose a contrasting color.

The brightness slider lets you choose between the brightest and darkest shade of the selected color, and the alpha slider controls the transparency of your fill or stroke color.

HSV color picker showing sliders for hue, saturation, value/brightness and transparency.
The HSV color picker options gives you precise control with sliders for hue, saturation, value (also known as brightness) and alpha (transparency) of your selected color.

Save colors to your file’s local library

Reusing colors is a key function of a design system, but it’s also useful in simple UI design to keep color use consistent and save time when updating the color of multiple objects simultaneously.

0:00
/0:15

You can save a color from the color picker:

  1. Select your chosen color’s fill or stroke swatch to open the color picker.
  2. Select the File Library in the color picker libraries menu.
  3. Use the + plus icon button to add the color to your local file library.
  4. In the Assets panel, under Local library colors, name your color.
Naming a color in local library assets as light slash lm body-bg.
Use slashes in your color name to group colors.

You can right-click a color in the Assets panel to rename, edit, or delete the color, as well as add it to a group.

0:00
/0:08

Using the same named color for multiple objects saves you a lot of time if you want to change the color. Just edit the color from the Assets panel; it will be updated across all objects using that color. In the video above, I changed the dark mode body text color from light purple to white, and it updated across all the text using the dm body-txt color fill. 

Using library colors

Once you’ve added a color, you can apply it to any fill or stroke. Library colors are accessible from the Assets tab, the color picker, or the color palette at the bottom of the workspace.

Choosing the dm accent-btn-txt color from the color palette. It is applied as the fill color in the Design panel.
Picking a color from the palette will apply that color as a fill to the currently selected object.

Hold down the alt key while picking the color from the palette to apply the color as a stroke.

Using colors from shared libraries

You can also connect an asset library of colors published and shared from another file. Shared libraries are great for sharing your team’s design system assets. In the example below, I use two different color libraries for my final design.

The Perfumery: Color tokens library in the Assets panel shows a list of colors from the library file.
The homepage design uses colors from the Perfumery: Color tokens library, which can be found in the Assets panel.
In the Perfumery: Color tokens library file there’s a sampler of text and background colors using colors from the color scales library file.
The Perfumery: Color tokens library file has a playground for testing the color tokens.

The file uses colors from the Color Scales library found in the Assets panel.

The color scales library file contains brand colors and color brightness scales for different hues.
The Color Scales library has many hues of color organized by brightness.

The 50 - 950 scale is a common way to organize color in web development frameworks.

How to connect a shared library

You can download shared libraries from Penpot’s template collection or make your own shared library for your team. Import the shared library file to your Penpot team, and then you can connect the library from the Assets panel:

  1. Open the Libraries panel.
  2. Find the library you want to use.
  3. Use the + plus icon button to connect the library to your file.
  4. You can find the colors from that library in the Assets panel, the color palette, or the color picker under the library name.
Searching in the libraries dialog for tokens shows the Perfumery: Color tokens file.
If you have many shared libraries, you can search to find exactly the one you want to use.

If you have connected multiple libraries to your file, you can switch between them in the color palette from the palette menu.

Choosing the context menu from the color palette brings up all the available color palettes.
You can also show recent colors in the color palette.

Publishing colors as a shared library

Your team is likely to have colors you want to use consistently across projects. These could be your brand colors, design system colors, or just a color palette you want to use for a new marketing campaign. 

You can share these colors as a library with your Penpot team:

  1. Save the colors you want to share to your local file library.
  2. Go to the Libraries panel inside the Assets tab and use the Publish button to publish your library.
0:00
/0:14

Colors and other assets shared in a library are only editable from the original library file, preventing your team (or future you!) from accidentally making changes to the library while working on another design. If you make an update to a library, you’ll receive a notification when you next edit a file that uses the library. 

Notification over the homepage design saying there are updates in shared libraries. There’s a more info link and buttons to dismiss or update.
The notification lets you know your shared library has an update.

The more info section provides details on the specific changes that will be applied to your working file.

You can publish and share multiple libraries in your team and connect libraries to each other, referencing assets stored in other libraries. These are powerful tools for creating complex, interconnected design systems.

Penpot plugins for working with color

Penpot plugins are now available from the Penpot Hub. Two great plugins, the Contrast checker and Create palette from library plugins, already enhance your experience working with color.

Contrast checker

The Contrast checker plugin gives you the color contrast ratio between any two colors. The contrast is essential for assessing the readability of text color on a background color, and the plugin gives you information on how well your colors work for normal text, large text and graphics.

Light orange background color is chosen along with a dark brown text color. The contrast ratio is 12.35:1.
The contrast ratio for the description box text and background is 12.35:1.

The background and text colors of the description box satisfy level AAA color contrast (the highest level of Web Content Accessibility Guidelines) for text and level AA (the second highest level) for graphics.

Create palette from library

The Create palette from library plugin takes all the colors in your Assets local library and renders them as labeled swatches on a board. 

Squares of swatches arranged in rows. The name of each color is displayed in the middle of each swatch.
This plugin saves you so much time when you want to get an overview of your colors and share them with your team in an accessible format.

Read more about Penpot plugins, how to install plugins, and how to create your own plugins. You can sign up to use Penpot with your team for free.