Gojek · Co-lead
Color Tokens
Asphalt's color-token restructure at Gojek, which I co-led, with the gradient fix and the brand split as my own parts.
The problem
Asphalt is Gojek's design system. Its color tokens had grown hard to use, and three problems stood out.
- Too few colors. Text and borders had no brand colors. GoFood needed more expressive colors for its redesign, and the merchant app's theme had no green for success.
- Brand colors everywhere. Brand colors started in icons, then spread into the colors meant to carry meaning, such as success and error. In the fill tokens alone, brand colors grew from 3 to 7. Each brand color was copied into every theme and every mode: light, dark and two high-contrast modes. With the planned additions, the consumer theme was heading for 13 green tokens.
- Gradients that failed contrast. In light mode, only 1 of the 6 gradients, the purple one, passed WCAG AA with white text, yet products kept putting text on them. Gradients came up in 50+ separate conversations in a single month.
My part
I co-led the restructure with a teammate. Two parts were my own. I wrote both proposals and was accountable for them:
- the gradient fix
- moving brand colors out of the themes and into one shared set
I also made the call to move themes to Figma variables, so a file switches theme by changing one setting instead of being restyled by hand. The variables proposal estimated that re-theming files by hand cost the two teams on other themes about $200,000. I shared the renaming of the product colors. Before this, I co-authored the grade-point system the work rests on and co-created the data-visualization palette, which the merchant app used most.
Grade points, the rule underneath
Every Asphalt color has a grade: the higher the grade, the darker the color. The gap between two grades usually tells a designer whether a pair passes contrast, without a checker. In the grade-point system, a gap of 50 grades between two colors is meant to pass AA for normal text, and a gap of 70 to pass AAA. A public Figma plugin applies it.
Gradients: contrast first
I fixed contrast before changing any structure, so teams got an accessibility win and nothing broke. For each gradient, I swapped in the closest color of the same hue with a grade high enough to pass.
After the fix, all 34 fill gradient tokens passed AA with white text, at 4.50:1 or more. The fix went to the Figma library, and to code through the token pipeline.
I then designed a simpler structure for the gradient library, with 15 intents. It reached the design libraries, but its code never shipped. A high-contrast gradient set stayed a plan.
Brand colors in their own set
I proposed one shared brand set, with the same structure as the other colors. One set, with light, dark and high-contrast values, serves every theme.
- Less work. The token files to edit for a new brand color went from 16 to 4.
- Accessible by rule. A brand fill sits at grade 50 or more, and brand text at 60 or more, so every pair passes AA, as the final token files confirm.
The wider restructure
With my teammate, I rebuilt how tokens are named, so each name says what the color is for. The chain has three steps: a primitive color with light and dark values, a theme token such as background/primary that points to it, and the component color bound to that token.
- We renamed the 7 product-category colors to plain color names, such as green and violet.
- Fills and icons named after products were retired. Four opacity levels, 70, 50, 30 and 10%, replaced the old overlay token.
- Every theme gained a success color.
- In all, the restructure added 44 new tokens, or 212 values once each is counted per mode and theme. Each theme went from 61 to 91 color tokens per mode, counting the shared brand set.
Where it stands
Shipped. Every Gojek app of the time used the new tokens, except the payments app, which had become a separate product. Every dollar figure here is an estimate of effort saved, from the impact report and design docs, not measured spend. The saved-effort figure is the impact report's estimate for one team, across design, engineering and the move to variables. Of that, the design doc estimated $105,278.80 saved in design work on future token additions. The brand-split proposal estimated about $144 a year saved on brand-color updates.
How token names are built: type, sub-type, role and intent
The data-visualization palette in light and dark, with neutral midpoints for divergent pairs
Next
Stencil Governance