Tokens Studio for Figma
  • Getting Started
    • Tokens Studio Plugin for Figma
    • Install the Figma Plugin
    • Pro Licence for the Figma Plugin
    • Join the Slack Community
    • Feature Requests - Featurebase
    • Changelog - Featurebase
  • Design Token Fundamentals
    • Intro to Design Tokens
      • Token Anatomy - Type
      • Token Anatomy - Value
      • Token Anatomy - Description
      • Token Anatomy - Name
  • Token Management
    • Token Types
      • Asset
      • Boolean
      • Border - Composite
      • Box Shadow - Composite
      • Color
        • Modified Colors (pro)
        • Gradient Colors
      • Dimension
        • Border Radius
        • Border Width
        • Sizing
        • Spacing
      • Number
      • Opacity
      • Other
      • Text (string)
      • Typography - Composite
        • Font Family
        • Font Weight
        • Font Fallbacks
        • Font Size
        • Line Height
        • Letter Spacing
        • Paragraph Indent
        • Paragraph Spacing
        • Text Case
        • Text Decoration
      • Composition (legacy)
    • Token Values
      • Token Values with References
      • Using Math in Token Values
    • Token Names
      • Token Name Technical Specs
      • Token Groups
      • Edit Token Names
    • Token Description
    • Token Sets
      • JSON View
  • Themes management
    • Themes (pro)
    • Themes that switch
  • Working in Figma
    • Variables and Tokens Studio
    • Styles and Tokens Studio
    • Export to Figma Guide
      • Export Options
      • Export Using Themes (pro)
      • Export Using Token Sets
      • Variables Skipped on Export
      • Styles with Variable References
    • Import from Figma Guide
      • Import Styles from Figma
      • Import Variables from Figma
        • Connect Themes to Imported Variables
        • Imported Variable Types and Token Types
    • Non-local Variables and Styles (pro)
    • Remove Tokens from Figma elements
    • Dev Mode in Figma
  • Settings Management
    • Plugin Settings
    • Base Font Size Setting
    • Token Format - W3C DTCG vs Legacy
  • Token Storage and Sync Integrations
    • Local Document - Figma File Token Storage
      • Figma Data Limits
    • Remote Token Storage Integrations
      • GitHub - Git Sync Provider
      • GitLab - Git Sync Provider
      • Bitbucket - Git Sync Provider
      • Azure DevOps - Git Sync Provider
      • JSONBin - Cloud Sync Provider
      • Supernova - Cloud Sync Provider
      • Tokens Studio Platform - Cloud Sync Provider
      • URL - Server Sync Provider
      • Generic Versioned Storage - Server Sync Provider
    • Multi-file Sync to Remote Storage (pro)
    • Manage Sync Providers
      • Edit Sync Provider
      • Change Active Sync Provider
      • Remove Sync Provider
    • Sync Changes to Remote Storage - Push and Pull
    • Branch Switching (pro) - Version Control
  • Inspect and Debug Tokens
    • Inspect Tokens
    • Remap Tokens
  • Transform Tokens for Development
    • Style Dictionary + SD Transforms
    • Official docs for Style Dictionary
  • Style Dictionary Playground
  • Troubleshooting
    • Reset Tokens from Dev Console
    • Tokens Studio Status
  • Open Source
    • Contribute
    • Shared Plugin Data
Powered by GitBook
On this page
  • Color - Token Type
  • Design decisions
  • Possible values
  • Values that reference another Token
  • Color picker
  • Reduced opacity (transparency)
  • Advanced color values
  • Apply Color Tokens
  • Color Styles in Figma
  • W3C DTCG Token Format
  • Transforming Tokens
  • Resources

Was this helpful?

Edit on GitHub
Export as PDF
PreviousBox Shadow - CompositeNextModified Colors (pro)

Last updated 4 months ago

Was this helpful?

Color - Token Type

Color Tokens define solid, reduced transparency, or gradient colors in a color space of your choice.


Design decisions

Color Tokens define the visibility and emphasis of design elements, ensuring we can read text easily, see the difference between objects in the background and foreground, and help us identify what we should pay attention to.

  • Many of the properties supported by this token are individually defined in CSS.

Color Tokens can be used to define these design properties:

  • Fill color

  • Border color

  • Shadow color


Possible values

Depending on how you define the Value of your Color Tokens you can achieve:

  • Solid color

    • Values written with full opacity

    • For example, a Hex color that is black #000000

  • Reduced opacity

    • Values written with reduced opacity

    • For example, an RGBA color that is black at 10% opacity rgba(0,0,0,0.1)

  • Gradients

    • Multiple color values with their position, direction, and angle defined

  • Modified colors (pro feature)

    • Adjusting the value of a base color using a specific operation, like lighten or darken.

Color spaces

Using the plugin for Figma, you can define your Color Tokens in the following color spaces:

  • Solid colors

    • Hex: #ff0000

    • RGB: rgb(255, 0, 0)

  • Reduced opacity with alpha values

    • RGBA: rgba(255, 0, 0, 1)

    • ARGB: #80FFFF00 (also known as Hex8)

    • HSLA: `hsla(120, 50%, 50%, 1)

  • Modified colors - Pro feature

    • LCH

    • SRGB

    • P3

    • HSL

When you create a Color Token using a color space that is not Hex, the plugin will resolve the color to the equivalent Hex value.

Values that reference another Token

When trying to reference another Token as the Value for a Color Token, you will see Tokens in the dropdown list that are:

  • Living in Token Sets that are currently active.

    • In the left menu on the plugin's Tokens page, a checkmark is visible next to the Token Set name.

  • Token Type is compatible:

    • The same = color

Compatible Token types

After you've created Color Tokens, they can be referenced in another Color Token and composite Tokens with a color property defined:


Color picker

Like all tokens in the plugin, you can Create a Color Token by opening its Create New Token form and defining the Token Name and Value.

However, Color Tokens can also be created using a Color Picker, accessible by selecting the color swatch to the left of the Token Value Input.

You can also use the Color Modifier (pro feature) with the Color Picker.


Reduced opacity (transparency)

Defining the Value of your Color Token as RGBA, HSLA or ARGB allows you to use the alpha value built into these color spaces.

The alpha modifier adjusts the opacity of the color.

In RGBA and HSLA the alpha value is defined as a numeric value that represents a percentage of adjustment for fine-grained control of transparency.

  • 0 = fully transparent (0%), making the color invisible

  • 0.5 = 50% opacity, making the color semi-transparent

  • 1 = fully opaque (100%)

For example, if you want a Color Token that is black with a 25% opacity you would write the value of the token to be:

rgba(0,0,0,0.25)

or

hsla(0, 0%, 0%, 0.25)

The ARGB format is sometimes called "Hex 8" by developers because it uses 8 hexadecimal digits: the first two digits represent the alpha (opacity) channel, and the next six digits represent the RGB color channels.

If we were to write the same Color Token that is black with a 25% opacity in ARGB it's value would be:

#40000000

Opacity with referenced Tokens

You can reference an existing Token as a part of an RGBA or HSLA Token Value to create a reduced opacity version of that Token.

For example:

rgba({colors.grey.900}, 0.06)

Creates a new token which references the grey.900 Color Token with only 6% opacity.

Known issue

When the value of a Color Token with reduced opacity includes a reference to another Color Token which has reduced opacity, the resolved value is incorrect.

It's also possible to write your RGBA or HSLA Token Value by referencing a Color Token and a unitless Number Token in the value.

For example, a Number Token called brand.opacity.border.default with a value of 0.06 would be added to the example above:

rgba({colors.grey.900}, {brand.opacity.border.default})

Ensure you are using a unitless Number Token!

Known issue

When the value of a Color Token with reduced opacity includes a reference to an opacity Token instead of a number Token.

The plugin may resolve the value correctly but when exporting to Figma or Code, there could be issues.

The Opacity Token Type in the plugin is intended for layer visibility in Figma only, not for use in Color Tokens as a modifier.

Opacity in the color picker

The opacity can be defined in the color picker by:

  • Typing the alpha value between 0 and 1 in the last input.

  • Adjusting the second slider which controls the alpha value.


Advanced color values

Select a card below to jump to its guide.


Apply Color Tokens

A Color Token defines the color styling of text, polygonal shape, frames, groups or graphic elements in Figma when the Token is applied.

You can apply the Token to fill the element with its value, or change its stroke color.

With one or more elements selected in Figma, right-click on the name of your chosen Color Token in the Plugin to see the it's options. Select your desired design property by clicking on it to apply the Token.

If you click the name of Token to apply it to an element without accessing the right-click Token menu, the Color styling will be applied to fill the container.

1

Fill

The value of the Color Token is applied to the entire layer selected.

2

Border

The value of the Color Token is applied to the stroke of the layer selected.

View Color Tokens as list

The Color Token has a special feature on the Tokens Page of the plugin, which allows you to toggle between a list or grid view.

This can be especially helpful if you need to see your Token Names while working in the plugin.


Color Styles in Figma

Color Tokens can be Exported to Figma as Color Styles. Tokens Studio also supports Styles with Variable References.

Here are some tips for creating Color Styles with Variable References using the Plugin.

Before you export your Color Tokens to Figma as styles, ensure the value is referencing another Token which has been Exported to Figma as a Variable.

When you Export to Figma as Color Styles, select these Options from the menu to create Color Styles with Variable References:

  • The option for Color styles is selected.

  • The option for Create styles with variable references is selected.

  • Themes and token sets where the referenced Tokens are located are active.

  • Themes and token sets where the variables are attached may need to be configured as reference only.


W3C DTCG Token Format


Transforming Tokens

When transforming Color Tokens with gradient values, there are specific configurations to be aware of.

The SD-Transforms generic package will convert color token values with Figma's "hex code RGBA" into actual rgba() format for CSS.


Resources

Mentioned in this doc:

Figma resources:

CSS resources:

Community resources:

Known issues and bugs

    • When the value of a Color Token with reduced opacity includes a reference to another Color Token which has reduced opacity, the resolved value is incorrect.

Requests, roadmap and changelog

This doesn't quite match the , which focuses on the foreground color of text elements specifically.

This is based on restrictions of the for Color Tokens.

If you prefer a visual way to create reduced opacity Color Tokens you can open the color picker tool in the plugin .

Color is an official token type in the W3C DTCG specifications () which is currently being updated to define expanded support for additional color spaces.

→

SD-Transforms -

Style Dictionary -

Design Tokens Community Group -

Design Tokens Community Group -

Design in Figma -

Design in Figma -

MDN Web Docs -

Nate Baldwin's + Adobe -

Tokens Studio Plugin GitHub -

Referencing a (base+opacity) and adding another opacity to that, doesn't give the correct result

Expanded support for color spaces -

JSON Enhancements for color tokens and theming -

CSS definition for color
current W3C DTCG specification
Box Shadow - Composite
Border - Composite
Opacity
Number
8.1 Color
→ We'd love to hear your thoughts on this! Join the conversation.
SD-Transforms Read-Me Doc, ts/color/css/hexrgba
Read Me
https://styledictionary.com/
W3C Draft
8.1 Color
Paints in Figma
The difference between variables and styles
color
Leonardo color tool with design token export
Open issues for Token Type Color
#1822
Feature Request
Feature Request
↓ More details on Gradients below.
↓More details on Modified Colors below.
(follow the steps above ↑)

Once a Token has been applied, it will remain attached until you manually remove it.

Page cover image
Creating a new Color Token in the Tokens Studio Plugin for Figma.
Cover

Color Tokens can be attached to Color Styles or Variables in Figma.

With a Color Token form open, selecting the swatch to the left of the Value input opens the color picker in the Plugin.
The right-click menu of a Color Token is open to reveal the design properties it can be applied to in Figma.
On the Tokens Page of the Plugin the Color Token has an icon-button to toggle between list and grid view.
Select the Export Styles and Variables from the Tokens page to configure the Options.
Cover

Modified Colors (pro)

The plugin supports creating dynamic colors by modifying a base color through the use of lighten, darken, alpha, or mix parameters.

Cover

Gradient Colors

However, like all Token Types, you can "force" a reference by manually entering the Token Name between curly brackets.

For example {token.name.here}

The value will show a broken reference until the originating Token Set is marked as enabled.

Jump to the guide on Token Values with References by selecting the card below to learn more.

The plugin currently supports Linear Gradient Colors within a Color Token by writing the value to .

Token Values with References
match CSS gradients

Jump to the guide on Exporting Tokens to Figma by selecting the card below to learn more.

💡 Something to share?

Engineers typically transform Tokens used in code with , which is tool-agnostic. Tokens coming from Tokens Studio require an additional step: , an npm package that prepares Tokens for Style Dictionary.

Export to Figma Guide
Submit it here!
Style Dictionary
@Tokens-studio/sd-transforms

🐞 If you are experiencing an issue not listed here, please reach out to us on the Troubleshooting channel of our , , or send us an email support@tokens.studio

community Slack
submit it on our feedback tool

Select the Token Type card below to jump to its guide.

💌 Visit to contribute or subscribe to updates.

https://feedback.tokens.studio/