OpenVibe Tokens

Your theme, as code

Take any OpenVibe theme into your own app, its light and dark halves together: the web, Android, iOS, Flutter or Figma. The colours are the ones the network paints.

Add it to your target and use MonokaiLightDarkTokens.colorAccentBase and the rest for colours, and OvScale.radiusMd, OvScale.spaceLg… for sizes; colorScheme says which half each one is.

// Monokai (dark) — generated by openvibe-shared/tokens v1 from the OpenVibe theme "monokai". Regenerate instead of editing.
import SwiftUI

/// The Monokai editor palette.
public enum MonokaiDarkTokens {
    public static let colorScheme: ColorScheme = .dark
    public static let colorBgBase = Color(.sRGB, red: 0.153, green: 0.157, blue: 0.133, opacity: 1)
    public static let colorBgSurface = Color(.sRGB, red: 0.118, green: 0.122, blue: 0.11, opacity: 1)
    public static let colorBgSubtle = Color(.sRGB, red: 0.243, green: 0.239, blue: 0.196, opacity: 1)
    public static let colorBgRaised = Color(.sRGB, red: 0.176, green: 0.18, blue: 0.153, opacity: 1)
    public static let colorBgHover = Color(.sRGB, red: 0.286, green: 0.282, blue: 0.243, opacity: 1)
    public static let colorBgInput = Color(.sRGB, red: 0.133, green: 0.137, blue: 0.118, opacity: 1)
    public static let colorTextPrimary = Color(.sRGB, red: 0.973, green: 0.973, blue: 0.949, opacity: 1)
    public static let colorTextSecondary = Color(.sRGB, red: 0.812, green: 0.812, blue: 0.761, opacity: 1)
    public static let colorTextMuted = Color(.sRGB, red: 0.722, green: 0.714, blue: 0.671, opacity: 1)
    public static let colorAccentBase = Color(.sRGB, red: 0.651, green: 0.886, blue: 0.18, opacity: 1)
    public static let colorAccentLight = Color(.sRGB, red: 0.769, green: 1, blue: 0.314, opacity: 1)
    public static let colorAccentDark = Color(.sRGB, red: 0.49, green: 0.675, blue: 0.11, opacity: 1)
    public static let colorAccentStrong = Color(.sRGB, red: 0.651, green: 0.886, blue: 0.18, opacity: 1)
    public static let colorAccentOn = Color(.sRGB, red: 0.043, green: 0.051, blue: 0.063, opacity: 1)
    public static let colorAccentOnStrong = Color(.sRGB, red: 0.043, green: 0.051, blue: 0.063, opacity: 1)
    public static let colorAccentGlow = Color(.sRGB, red: 0.651, green: 0.886, blue: 0.18, opacity: 0.35)
    public static let colorLineBase = Color(.sRGB, red: 0.286, green: 0.282, blue: 0.243, opacity: 1)
    public static let colorLineStrong = Color(.sRGB, red: 0.357, green: 0.353, blue: 0.314, opacity: 1)
    public static let colorStatusOkBase = Color(.sRGB, red: 0.133, green: 0.773, blue: 0.369, opacity: 1)
    public static let colorStatusOkText = Color(.sRGB, red: 0.271, green: 0.808, blue: 0.471, opacity: 1)
    public static let colorStatusWarnBase = Color(.sRGB, red: 0.902, green: 0.859, blue: 0.455, opacity: 1)
    public static let colorStatusWarnText = Color(.sRGB, red: 0.902, green: 0.859, blue: 0.455, opacity: 1)
    public static let colorStatusBadBase = Color(.sRGB, red: 0.976, green: 0.149, blue: 0.447, opacity: 1)
    public static let colorStatusBadText = Color(.sRGB, red: 0.988, green: 0.592, blue: 0.733, opacity: 1)
    public static let colorStatusInfoBase = Color(.sRGB, red: 0.4, green: 0.851, blue: 0.937, opacity: 1)
    public static let colorStatusInfoText = Color(.sRGB, red: 0.4, green: 0.851, blue: 0.937, opacity: 1)
    public static let colorStatusLiveBase = Color(.sRGB, red: 0.937, green: 0.267, blue: 0.267, opacity: 1)
    public static let colorStatusLiveText = Color(.sRGB, red: 0.969, green: 0.62, blue: 0.62, opacity: 1)
}

/// Monokai's greens on a calm off-white page.
public enum MonokaiLightTokens {
    public static let colorScheme: ColorScheme = .light
    public static let colorBgBase = Color(.sRGB, red: 0.98, green: 0.98, blue: 0.965, opacity: 1)
    public static let colorBgSurface = Color(.sRGB, red: 0.945, green: 0.945, blue: 0.918, opacity: 1)
    public static let colorBgSubtle = Color(.sRGB, red: 0.906, green: 0.906, blue: 0.871, opacity: 1)
    public static let colorBgRaised = Color(.sRGB, red: 0.992, green: 0.992, blue: 0.98, opacity: 1)
    public static let colorBgHover = Color(.sRGB, red: 0.925, green: 0.925, blue: 0.89, opacity: 1)
    public static let colorBgInput = Color(.sRGB, red: 0.965, green: 0.965, blue: 0.941, opacity: 1)
    public static let colorTextPrimary = Color(.sRGB, red: 0.153, green: 0.157, blue: 0.133, opacity: 1)
    public static let colorTextSecondary = Color(.sRGB, red: 0.306, green: 0.31, blue: 0.267, opacity: 1)
    public static let colorTextMuted = Color(.sRGB, red: 0.404, green: 0.408, blue: 0.361, opacity: 1)
    public static let colorAccentBase = Color(.sRGB, red: 0.294, green: 0.443, blue: 0, opacity: 1)
    public static let colorAccentLight = Color(.sRGB, red: 0.325, green: 0.443, blue: 0.071, opacity: 1)
    public static let colorAccentDark = Color(.sRGB, red: 0.263, green: 0.4, blue: 0, opacity: 1)
    public static let colorAccentStrong = Color(.sRGB, red: 0.294, green: 0.443, blue: 0, opacity: 1)
    public static let colorAccentOn = Color(.sRGB, red: 1, green: 1, blue: 1, opacity: 1)
    public static let colorAccentOnStrong = Color(.sRGB, red: 1, green: 1, blue: 1, opacity: 1)
    public static let colorAccentGlow = Color(.sRGB, red: 0.294, green: 0.443, blue: 0, opacity: 0.35)
    public static let colorLineBase = Color(.sRGB, red: 0.863, green: 0.863, blue: 0.816, opacity: 1)
    public static let colorLineStrong = Color(.sRGB, red: 0.804, green: 0.804, blue: 0.749, opacity: 1)
    public static let colorStatusOkBase = Color(.sRGB, red: 0.133, green: 0.773, blue: 0.369, opacity: 1)
    public static let colorStatusOkText = Color(.sRGB, red: 0.078, green: 0.463, blue: 0.22, opacity: 1)
    public static let colorStatusWarnBase = Color(.sRGB, red: 0.961, green: 0.62, blue: 0.043, opacity: 1)
    public static let colorStatusWarnText = Color(.sRGB, red: 0.557, green: 0.361, blue: 0.024, opacity: 1)
    public static let colorStatusBadBase = Color(.sRGB, red: 0.937, green: 0.267, blue: 0.267, opacity: 1)
    public static let colorStatusBadText = Color(.sRGB, red: 0.729, green: 0.208, blue: 0.208, opacity: 1)
    public static let colorStatusInfoBase = Color(.sRGB, red: 0.22, green: 0.741, blue: 0.973, opacity: 1)
    public static let colorStatusInfoText = Color(.sRGB, red: 0.125, green: 0.431, blue: 0.565, opacity: 1)
    public static let colorStatusLiveBase = Color(.sRGB, red: 0.937, green: 0.267, blue: 0.267, opacity: 1)
    public static let colorStatusLiveText = Color(.sRGB, red: 0.729, green: 0.208, blue: 0.208, opacity: 1)
}

/// The OpenVibe kit's radius, space, size, type and motion scales: the same in every theme.
public enum OvScale {
    public static let radiusSm: CGFloat = 10
    public static let radiusMd: CGFloat = 14
    public static let radiusLg: CGFloat = 20
    public static let radiusPill: CGFloat = 999
    public static let spaceXs: CGFloat = 4
    public static let spaceSm: CGFloat = 8
    public static let spaceMd: CGFloat = 12
    public static let spaceLg: CGFloat = 16
    public static let spaceXl: CGFloat = 24
    public static let spaceXxl: CGFloat = 32
    public static let sizeTap: CGFloat = 44
    public static let sizeIcon: CGFloat = 20
    public static let sizeAvatar: CGFloat = 34
    public static let typeSizeCaption: CGFloat = 12
    public static let typeSizeMeta: CGFloat = 13
    public static let typeSizeBody: CGFloat = 15
    public static let typeSizeLead: CGFloat = 17
    public static let typeSizeTitle: CGFloat = 20
    public static let typeSizeHeadline: CGFloat = 24
    public static let typeSizeDisplay: CGFloat = 34
    public static let motionDurationFast: Double = 0.18
    public static let motionDurationBase: Double = 0.26
    public static let motionDurationSlow: Double = 0.36
    public static let motionDurationReduced: Double = 0
}

Files your tools can fetch

This theme on its own, with the motion every OpenVibe page shares and the mark’s colours. Each one has a lasting address a build or a design tool can read straight from here.

Every colour token · 28 of them
  • color.bg.base#272822#fafaf6The page behind everything
  • color.bg.surface#1e1f1c#f1f1eaBands and side panels
  • color.bg.subtle#3e3d32#e7e7deWells, tracks and quiet fills
  • color.bg.raised#2d2e27#fdfdfaCards, rows and sheets
  • color.bg.hover#49483e#ecece3A control under the pointer or finger
  • color.bg.input#22231e#f6f6f0Text fields
  • color.text.primary#f8f8f2#272822Body text and titles
  • color.text.secondary#cfcfc2#4e4f44Supporting text
  • color.text.muted#b8b6ab#67685cHints and meta lines
  • color.accent.base#a6e22e#4b7100Links, icons, focus rings
  • color.accent.light#c4ff50#537112The accent a step lighter
  • color.accent.dark#7dac1c#436600The accent a step darker
  • color.accent.strong#a6e22e#4b7100Filled buttons
  • color.accent.on#0b0d10#ffffffText on the accent
  • color.accent.onStrong#0b0d10#ffffffText on a filled button
  • color.accent.glowrgba(166,226,46,0.35)rgba(75,113,0,0.35)Glows and halos
  • color.line.base#49483e#dcdcd0Dividers and outlines
  • color.line.strong#5b5a50#cdcdbfOutlines that must show
  • color.status.ok.base#22c55e#22c55eSuccess fills
  • color.status.ok.text#45ce78#147638Success text on any surface
  • color.status.warn.base#e6db74#f59e0bWarning fills
  • color.status.warn.text#e6db74#8e5c06Warning text on any surface
  • color.status.bad.base#f92672#ef4444Danger fills
  • color.status.bad.text#fc97bb#ba3535Danger text on any surface
  • color.status.info.base#66d9ef#38bdf8Information fills
  • color.status.info.text#66d9ef#206e90Information text on any surface
  • color.status.live.base#ef4444#ef4444LIVE badges
  • color.status.live.text#f79e9e#ba3535LIVE text on any surface

Every theme also carries the kit's scales: radius.*, space.* (4 to 32), size.tap (44), type.size.*, type.weight.* and motion.*.

Why tokens, and what is next

A theme on OpenVibe is one set of design tokens: semantic names such as color.accent.strong and space.lg, kept apart from any one platform. The web reads them as CSS variables today. An Android or iOS app reads the same values in Compose or SwiftUI, so a native app wears your theme without being a web page in a frame.

The format is the W3C Design Tokens one, so the same file works in Style Dictionary, Tokens Studio and Figma. Next: the kit's components described the same way (anatomy, states, roles), so a page made on OpenVibe.Design can be drawn natively too.

Change this theme in the studio The tokens API