This repository was archived by the owner on Nov 24, 2023. It is now read-only.
Colour Tokens Spec #61
matthewmorek
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Background
Colour tokens help improve the developer experience of Kotlin and SwiftUI engineers by providing a standardised and efficient way to implement colour consistently in their applications.
Objective
Our goal is to create a universal JSON structure that could be converted from Figma (Tokens Studio) format into a final structure digestible by iOS and Android platforms at build time to generate required values for using in developing mobile applications.
Proposal
Sharing a unified colour/theme definition across different platforms (Kotlin/Android, SwiftUI/iOS, and Figma for design) can be highly efficient, reduce the probability of mistakes, and ensure a visually consistent user interface. We're looking for comments on the following proposal for a colour tokens format.
Specification
Based on the information gathered about using colour in Kotlin and SwiftUI, here’s a suggested sample JSON structure for use with both languages:
Semantic colour tokens are split by
brand
and bytheme
, ensure there's always two JSON files for each brand:dark
andlight
.Each file will have exactly the same structure, just the values may be different, depending on the intention.
Note
Each value uses a
HEX8
colour format with alpha channel as the first number:#{alpha}{colour}
, which can translate to#FF00FF02
.Beta Was this translation helpful? Give feedback.
All reactions