# Roles URL: /foundations/color/color-role Source: https://github.com/daangn/seed-design/blob/dev/docs/content/foundations/color/color-role.mdx Role-based colors assign specific functional roles to colors (primary action, error, information, etc.) to ensure consistency, clarity, and accessibility throughout the user interface. Crispy's role-based color system consists of a Property, Role, Variant, and State framework. ## Property It starts with three basic properties: Foreground, Background, and Stroke. ### Background Colors used for the background of the entire screen or UI. ### Foreground Colors used for foreground elements of the UI, such as text and icons. ### Stroke Colors used for lines that distinguish boundaries or outlines of UI elements. ## Role In addition to the basic categories of foreground, background, and stroke, it includes specific roles such as brand, neutral, and positive. These role keywords add a layer that can express functional and semantic differences between colors. Some roles can be applied across multiple categories (e.g. [$color.fg.brand](/foundations/design-token/reference/%24color.fg.brand), [$color.bg.brand-solid](/foundations/design-token/reference/%24color.bg.brand-solid), [$color.stroke.brand-solid](/foundations/design-token/reference/%24color.stroke.brand-solid)), ensuring consistent use throughout the user interface. ### Brand Brand colors help brand-related elements be recognized immediately. They can also be used to emphasize the most important actions on the screen. - [$color.fg.brand](/foundations/design-token/reference/%24color.fg.brand) - [$color.bg.brand-solid](/foundations/design-token/reference/%24color.bg.brand-solid) - [$color.bg.brand-solid-pressed](/foundations/design-token/reference/%24color.bg.brand-solid-pressed) - [$color.stroke.brand-solid](/foundations/design-token/reference/%24color.stroke.brand-solid) ### Neutral Neutral colors are the base colors used for general content. While they have lower prominence, they are still used for elements that need visibility. - [$color.fg.neutral](/foundations/design-token/reference/%24color.fg.neutral) - [$color.fg.neutral-muted](/foundations/design-token/reference/%24color.fg.neutral-muted) - [$color.fg.neutral-subtle](/foundations/design-token/reference/%24color.fg.neutral-subtle) - [$color.fg.neutral-inverted](/foundations/design-token/reference/%24color.fg.neutral-inverted) - [$color.bg.neutral-solid](/foundations/design-token/reference/%24color.bg.neutral-solid) - [$color.bg.neutral-weak](/foundations/design-token/reference/%24color.bg.neutral-weak) ### Positive Positive colors are used to represent successful actions, confirmations, or positive states. - [$color.fg.positive](/foundations/design-token/reference/%24color.fg.positive) - [$color.fg.positive-contrast](/foundations/design-token/reference/%24color.fg.positive-contrast) - [$color.bg.positive-solid](/foundations/design-token/reference/%24color.bg.positive-solid) - [$color.bg.positive-solid-pressed](/foundations/design-token/reference/%24color.bg.positive-solid-pressed) ### Warning Warning colors are used to communicate warning messages or information that require user attention. - [$color.fg.warning](/foundations/design-token/reference/%24color.fg.warning) - [$color.fg.warning-contrast](/foundations/design-token/reference/%24color.fg.warning-contrast) - [$color.bg.warning-solid](/foundations/design-token/reference/%24color.bg.warning-solid) - [$color.bg.warning-weak](/foundations/design-token/reference/%24color.bg.warning-weak) ### Critical Critical colors are used to represent errors, alerts, or important issues. They clearly communicate negative states or problems to users, drawing immediate attention. ![Example of using $color.fg.critical-contrast and $color.bg.critical-weak]() - [$color.fg.critical](/foundations/design-token/reference/%24color.fg.critical) - [$color.fg.critical-contrast](/foundations/design-token/reference/%24color.fg.critical-contrast) - [$color.bg.critical-solid](/foundations/design-token/reference/%24color.bg.critical-solid) - [$color.bg.critical-weak](/foundations/design-token/reference/%24color.bg.critical-weak) ![Example of using $color.bg.critical-solid]() ### Informative Informative colors are used to provide useful information to users or explain states. These colors make information delivery intuitive. - [$color.fg.informative](/foundations/design-token/reference/%24color.fg.informative) - [$color.fg.informative-contrast](/foundations/design-token/reference/%24color.fg.informative-contrast) - [$color.bg.informative-solid](/foundations/design-token/reference/%24color.bg.informative-solid) - [$color.bg.informative-weak](/foundations/design-token/reference/%24color.bg.informative-weak) ## Layer Layer colors are used to represent depth and hierarchy in the interface. They help visually distinguish different layers in the UI. ![Layer colors in light and dark modes]() ![Example of layer color usage]() ## Variant Even colors with the same role may need various variants depending on the intent. For example, a background with a Positive role can have variants such as [$color.bg.positive-weak](/foundations/design-token/reference/%24color.bg.positive-weak) with low emphasis or [$color.bg.positive-solid](/foundations/design-token/reference/%24color.bg.positive-solid) with high emphasis. ## Status Colors can change based on the state of UI elements. For example, when a button is pressed, the color change can [indicate](/foundations/state) to the user that an interaction has occurred. ## Tokens ### Foreground | Token | theme-light | theme-dark | | --- | --- | --- | | $color.fg.brand | $color.palette.carrot-600 | $color.palette.carrot-700 | | $color.fg.brand-contrast | $color.palette.carrot-700 | $color.palette.carrot-700 | | $color.fg.critical | $color.palette.red-700 | $color.palette.red-700 | | $color.fg.critical-contrast | $color.palette.red-900 | $color.palette.red-900 | | $color.fg.disabled | $color.palette.gray-500 | $color.palette.gray-500 | | $color.fg.informative | $color.palette.blue-700 | $color.palette.blue-700 | | $color.fg.informative-contrast | $color.palette.blue-900 | $color.palette.blue-900 | | $color.fg.neutral | $color.palette.gray-1000 | $color.palette.gray-1000 | | $color.fg.neutral-inverted | $color.palette.gray-00 | $color.palette.gray-100 | | $color.fg.neutral-muted | $color.palette.gray-800 | $color.palette.gray-800 | | $color.fg.neutral-subtle | $color.palette.gray-700 | $color.palette.gray-700 | | $color.fg.placeholder | $color.palette.gray-600 | $color.palette.gray-600 | | $color.fg.positive | $color.palette.green-700 | $color.palette.green-700 | | $color.fg.positive-contrast | $color.palette.green-900 | $color.palette.green-900 | | $color.fg.warning | $color.palette.yellow-700 | $color.palette.yellow-700 | | $color.fg.warning-contrast | $color.palette.yellow-900 | $color.palette.yellow-900 | ### Background | Token | theme-light | theme-dark | | --- | --- | --- | | $color.bg.brand-solid | $color.palette.carrot-600 | $color.palette.carrot-700 | | $color.bg.brand-solid-pressed | $color.palette.carrot-700 | $color.palette.carrot-800 | | $color.bg.brand-weak | $color.palette.carrot-100 | $color.palette.carrot-100 | | $color.bg.brand-weak-pressed | $color.palette.carrot-200 | $color.palette.carrot-200 | | $color.bg.critical-solid | $color.palette.red-700 | $color.palette.red-600 | | $color.bg.critical-solid-pressed | $color.palette.red-800 | $color.palette.red-700 | | $color.bg.critical-weak | $color.palette.red-100 | $color.palette.red-100 | | $color.bg.critical-weak-pressed | $color.palette.red-200 | $color.palette.red-200 | | $color.bg.disabled | $color.palette.gray-200 | $color.palette.gray-300 | | $color.bg.informative-solid | $color.palette.blue-700 | $color.palette.blue-600 | | $color.bg.informative-solid-pressed | $color.palette.blue-800 | $color.palette.blue-700 | | $color.bg.informative-weak | $color.palette.blue-100 | $color.palette.blue-100 | | $color.bg.informative-weak-pressed | $color.palette.blue-200 | $color.palette.blue-200 | | $color.bg.layer-basement | $color.palette.gray-200 | $color.palette.gray-00 | | $color.bg.layer-default | $color.palette.gray-00 | $color.palette.gray-100 | | $color.bg.layer-default-pressed | $color.palette.gray-100 | $color.palette.gray-300 | | $color.bg.layer-fill | $color.palette.gray-100 | $color.palette.gray-200 | | $color.bg.layer-floating | $color.palette.gray-00 | $color.palette.gray-200 | | $color.bg.layer-floating-pressed | $color.palette.gray-100 | $color.palette.gray-300 | | $color.bg.magic-weak | #f9f2ee | #201f1f | | $color.bg.neutral-inverted | $color.palette.gray-900 | $color.palette.gray-1000 | | $color.bg.neutral-inverted-pressed | $color.palette.gray-800 | $color.palette.gray-800 | | $color.bg.neutral-solid | $color.palette.gray-1000 | $color.palette.gray-300 | | $color.bg.neutral-weak | $color.palette.gray-200 | $color.palette.gray-300 | | $color.bg.neutral-weak-alpha | $color.palette.static-black-alpha-200 | $color.palette.static-white-alpha-200 | | $color.bg.neutral-weak-alpha-pressed | $color.palette.static-black-alpha-300 | $color.palette.static-white-alpha-300 | | $color.bg.neutral-weak-pressed | $color.palette.gray-300 | $color.palette.gray-400 | | $color.bg.overlay | $color.palette.static-black-alpha-700 | $color.palette.static-black-alpha-700 | | $color.bg.overlay-muted | $color.palette.static-black-alpha-500 | $color.palette.static-black-alpha-500 | | $color.bg.positive-solid | $color.palette.green-700 | $color.palette.green-500 | | $color.bg.positive-solid-pressed | $color.palette.green-800 | $color.palette.green-600 | | $color.bg.positive-weak | $color.palette.green-100 | $color.palette.green-100 | | $color.bg.positive-weak-pressed | $color.palette.green-200 | $color.palette.green-200 | | $color.bg.transparent | #00000000 | #ffffff00 | | $color.bg.transparent-pressed | $color.palette.static-black-alpha-100 | $color.palette.static-white-alpha-50 | | $color.bg.transparent-selected | $color.palette.static-black-alpha-200 | $color.palette.static-white-alpha-100 | | $color.bg.transparent-selected-pressed | $color.palette.static-black-alpha-300 | $color.palette.static-white-alpha-200 | | $color.bg.warning-solid | $color.palette.yellow-300 | $color.palette.yellow-800 | | $color.bg.warning-solid-pressed | $color.palette.yellow-400 | $color.palette.yellow-900 | | $color.bg.warning-weak | $color.palette.yellow-100 | $color.palette.yellow-100 | | $color.bg.warning-weak-pressed | $color.palette.yellow-200 | $color.palette.yellow-200 | ### Stroke | Token | theme-light | theme-dark | | --- | --- | --- | | $color.stroke.brand-solid | $color.palette.carrot-700 | $color.palette.carrot-700 | | $color.stroke.brand-weak | $color.palette.carrot-300 | $color.palette.carrot-300 | | $color.stroke.critical-solid | $color.palette.red-700 | $color.palette.red-700 | | $color.stroke.critical-weak | $color.palette.red-300 | $color.palette.red-300 | | $color.stroke.focus-ring | $color.palette.blue-600 | $color.palette.blue-600 | | $color.stroke.informative-solid | $color.palette.blue-700 | $color.palette.blue-700 | | $color.stroke.informative-weak | $color.palette.blue-300 | $color.palette.blue-300 | | $color.stroke.neutral-contrast | $color.palette.gray-1000 | $color.palette.gray-1000 | | $color.stroke.neutral-muted | $color.palette.static-black-alpha-300 | $color.palette.static-white-alpha-100 | | $color.stroke.neutral-solid | $color.palette.gray-800 | $color.palette.gray-800 | | $color.stroke.neutral-subtle | $color.palette.static-black-alpha-200 | $color.palette.static-white-alpha-50 | | $color.stroke.neutral-weak | $color.palette.gray-400 | $color.palette.gray-400 | | $color.stroke.positive-solid | $color.palette.green-700 | $color.palette.green-700 | | $color.stroke.positive-weak | $color.palette.green-300 | $color.palette.green-300 | | $color.stroke.warning-solid | $color.palette.yellow-700 | $color.palette.yellow-700 | | $color.stroke.warning-weak | $color.palette.yellow-300 | $color.palette.yellow-300 |