Learn how to adjust colors in Ant Design System for Figma.
In the Ant Design System for Figma, a fundamental understanding of how colors operate in Ant Design for React is essential. Ant Design utilizes a color algorithm to derive color palettes, which are based on a single color value from the Seed group. For instance, when a developer sets a colorPrimary token value to '#6514ce,' it triggers the generation of a comprehensive palette for the entire color primary group, as depicted below.
This approach is applicable to other color categories as well, such as colorSuccess, colorWarning, and colorInfo. Moreover, you can also generate a neutral color palette based on a single token, 'colorTextBase.' To observe how this process works in Ant Design, you can experiment with the Theme Editor tool.
In the forthcoming section of this article, we will delve into various methods for adjusting colors within the Ant Design System for Figma.
Ant Design, much like numerous other design systems, offers a set of predefined color palettes to serve as a starting point. These palettes consist of 12 base colors, which you can employ as your primary or functional colors. You can access these colors in the Ant Design System for Figma within the "Base Colors" frame located on the Colors page, as well as in the variables panel. Each color within the base group is also available as a Figma color variable, making it usable across the entire system.
By default, Ant Design designates the Daybreak Blue color from the Base color palettes as the primary color. Below, you will find guidance on how to modify the primary color from Daybreak Blue to a different Base color or a color of your choosing.
In the Ant Design System for Figma, brand colors are categorized into the following groups:
By organizing colors into these categories, Ant Design System for Figma streamlines the process of selecting and applying colors to different parts of your project, ensuring a cohesive and user-friendly visual experience.
There are two approaches for adapting brand colors to meet your project's requirements. The first method involves leveraging the pre-existing base color palettes provided by Ant Design, while the second method demonstrates how to incorporate your own custom colors. These methods, as outlined below, are suitable for adjusting both the Primary and Functional colors. It's important to note that the Link and Control groups don't necessarily need direct modifications, as they derive their values from the Primary color group. However, should the need arise, you can certainly customize or assign specific values for variables within these groups.
By providing these two options, Ant Design System for Figma offers flexibility in tailoring your brand colors to suit your design preferences and project needs.
To use base color palettes as your brand's primary color, you can follow the example below, in which you will learn how to change your primary color from Blue to Purple.
There are two options that you can use to change the default brand colors to your own colors. The first method is the most convenient and introduces the Palette Generation Tool from Ant Design. The second way is more flexible but requires more changes in the React project config later on. Below, you can learn how to use both methods.
Option 1 offers a convenient and efficient way to create a color palette for your app using the Ant Design Palette Generation Tool. With this tool, you can generate a unified color scheme for both light and dark themes by specifying just one base color. This streamlined process harnesses Ant Design's built-in color algorithm, simplifying the task of developers when configuring color schemes. Instead of manually handling numerous color values, developers only need to provide a single color input.
For instance, to modify the entire palette for the primary color, developers need to set a single value for the "colorPrimary" token, as demonstrated below. This one adjustment triggers the automatic generation of a harmonious palette for both themes, reducing complexity and enhancing design consistency.
In contrast, Option 2 offers greater flexibility for those who prefer to rely on a custom color palette. If you have a specific set of 10 color values that you wish to use as your primary color, you can specify each of these colors individually in the React project's configuration. This approach grants you complete control over your color choices, but it does involve the manual input of all the color values, as illustrated in the example below.
To use the generated palette in the Ant Design System for Figma, we will need to create a new base color palette and then reference all created colors in our color primary variables group. As an example, let’s create a primary color palette based on a hex value ‘#2f12dd’.
Part 1. Create a base color palette
Part 2. Reference colors
Note for developers
If your design team used this option, you can change the colorPrimary token in your ConfigProvider to generate the entire palette based on one color.
If you want to use your own hex values for your primary color palette, you need also to create the base palette for your color and then reference it in the color primary group.
Part 1. Create a base color palette
Part 2. Reference colors
In the Ant Design System for Figma, neutral colors cover Text, Icon, Background, Border, and Fill color elements. You have the flexibility to adjust variables within these groups using the variables panel. When making changes, keep in mind that editing variables in the Seed and Map groups will apply your modifications globally. For instance, if you modify the "colorText" variable, it will also affect "colorTextHeading," eliminating the need to make the same changes multiple times.