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 DraculaDarkTokens.colorAccentBase and the rest for colours, and OvScale.radiusMd, OvScale.spaceLg… for sizes; colorScheme says which half each one is.

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

/// The Dracula scheme, as its authors drew it.
public enum DraculaDarkTokens {
    public static let colorScheme: ColorScheme = .dark
    public static let colorBgBase = Color(.sRGB, red: 0.157, green: 0.165, blue: 0.212, opacity: 1)
    public static let colorBgSurface = Color(.sRGB, red: 0.118, green: 0.122, blue: 0.161, opacity: 1)
    public static let colorBgSubtle = Color(.sRGB, red: 0.204, green: 0.216, blue: 0.275, opacity: 1)
    public static let colorBgRaised = Color(.sRGB, red: 0.173, green: 0.18, blue: 0.235, opacity: 1)
    public static let colorBgHover = Color(.sRGB, red: 0.227, green: 0.239, blue: 0.314, opacity: 1)
    public static let colorBgInput = Color(.sRGB, red: 0.129, green: 0.133, blue: 0.173, 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.749, green: 0.749, blue: 0.698, opacity: 1)
    public static let colorTextMuted = Color(.sRGB, red: 0.62, green: 0.659, blue: 0.773, opacity: 1)
    public static let colorAccentBase = Color(.sRGB, red: 0.741, green: 0.576, blue: 0.976, opacity: 1)
    public static let colorAccentLight = Color(.sRGB, red: 0.831, green: 0.722, blue: 1, opacity: 1)
    public static let colorAccentDark = Color(.sRGB, red: 0.608, green: 0.427, blue: 0.859, opacity: 1)
    public static let colorAccentStrong = Color(.sRGB, red: 0.741, green: 0.576, blue: 0.976, 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.741, green: 0.576, blue: 0.976, opacity: 0.35)
    public static let colorLineBase = Color(.sRGB, red: 0.267, green: 0.278, blue: 0.353, opacity: 1)
    public static let colorLineStrong = Color(.sRGB, red: 0.337, green: 0.349, blue: 0.439, opacity: 1)
    public static let colorStatusOkBase = Color(.sRGB, red: 0.314, green: 0.98, blue: 0.482, opacity: 1)
    public static let colorStatusOkText = Color(.sRGB, red: 0.314, green: 0.98, blue: 0.482, opacity: 1)
    public static let colorStatusWarnBase = Color(.sRGB, red: 0.945, green: 0.98, blue: 0.549, opacity: 1)
    public static let colorStatusWarnText = Color(.sRGB, red: 0.945, green: 0.98, blue: 0.549, opacity: 1)
    public static let colorStatusBadBase = Color(.sRGB, red: 1, green: 0.333, blue: 0.333, opacity: 1)
    public static let colorStatusBadText = Color(.sRGB, red: 1, green: 0.522, blue: 0.522, opacity: 1)
    public static let colorStatusInfoBase = Color(.sRGB, red: 0.545, green: 0.914, blue: 0.992, opacity: 1)
    public static let colorStatusInfoText = Color(.sRGB, red: 0.545, green: 0.914, blue: 0.992, opacity: 1)
    public static let colorStatusLiveBase = Color(.sRGB, red: 1, green: 0.333, blue: 0.333, opacity: 1)
    public static let colorStatusLiveText = Color(.sRGB, red: 1, green: 0.522, blue: 0.522, opacity: 1)
}

/// Dracula's daylight twin: purple ink on warm parchment.
public enum DraculaLightTokens {
    public static let colorScheme: ColorScheme = .light
    public static let colorBgBase = Color(.sRGB, red: 1, green: 0.984, blue: 0.922, opacity: 1)
    public static let colorBgSurface = Color(.sRGB, red: 0.965, green: 0.941, blue: 0.847, opacity: 1)
    public static let colorBgSubtle = Color(.sRGB, red: 0.925, green: 0.894, blue: 0.776, opacity: 1)
    public static let colorBgRaised = Color(.sRGB, red: 1, green: 0.992, blue: 0.953, opacity: 1)
    public static let colorBgHover = Color(.sRGB, red: 0.949, green: 0.918, blue: 0.816, opacity: 1)
    public static let colorBgInput = Color(.sRGB, red: 0.984, green: 0.965, blue: 0.886, opacity: 1)
    public static let colorTextPrimary = Color(.sRGB, red: 0.122, green: 0.122, blue: 0.122, opacity: 1)
    public static let colorTextSecondary = Color(.sRGB, red: 0.31, green: 0.294, blue: 0.22, opacity: 1)
    public static let colorTextMuted = Color(.sRGB, red: 0.424, green: 0.4, blue: 0.294, opacity: 1)
    public static let colorAccentBase = Color(.sRGB, red: 0.392, green: 0.29, blue: 0.788, opacity: 1)
    public static let colorAccentLight = Color(.sRGB, red: 0.42, green: 0.325, blue: 0.737, opacity: 1)
    public static let colorAccentDark = Color(.sRGB, red: 0.29, green: 0.2, blue: 0.639, opacity: 1)
    public static let colorAccentStrong = Color(.sRGB, red: 0.392, green: 0.29, blue: 0.788, 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.392, green: 0.29, blue: 0.788, opacity: 0.35)
    public static let colorLineBase = Color(.sRGB, red: 0.89, green: 0.855, blue: 0.722, opacity: 1)
    public static let colorLineStrong = Color(.sRGB, red: 0.839, green: 0.796, blue: 0.639, 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.447, blue: 0.216, 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.537, green: 0.345, 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.122, green: 0.416, blue: 0.545, 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#282a36#fffbebThe page behind everything
  • color.bg.surface#1e1f29#f6f0d8Bands and side panels
  • color.bg.subtle#343746#ece4c6Wells, tracks and quiet fills
  • color.bg.raised#2c2e3c#fffdf3Cards, rows and sheets
  • color.bg.hover#3a3d50#f2ead0A control under the pointer or finger
  • color.bg.input#21222c#fbf6e2Text fields
  • color.text.primary#f8f8f2#1f1f1fBody text and titles
  • color.text.secondary#bfbfb2#4f4b38Supporting text
  • color.text.muted#9ea8c5#6c664bHints and meta lines
  • color.accent.base#bd93f9#644ac9Links, icons, focus rings
  • color.accent.light#d4b8ff#6b53bcThe accent a step lighter
  • color.accent.dark#9b6ddb#4a33a3The accent a step darker
  • color.accent.strong#bd93f9#644ac9Filled buttons
  • color.accent.on#0b0d10#ffffffText on the accent
  • color.accent.onStrong#0b0d10#ffffffText on a filled button
  • color.accent.glowrgba(189,147,249,0.35)rgba(100,74,201,0.35)Glows and halos
  • color.line.base#44475a#e3dab8Dividers and outlines
  • color.line.strong#565970#d6cba3Outlines that must show
  • color.status.ok.base#50fa7b#22c55eSuccess fills
  • color.status.ok.text#50fa7b#147237Success text on any surface
  • color.status.warn.base#f1fa8c#f59e0bWarning fills
  • color.status.warn.text#f1fa8c#895806Warning text on any surface
  • color.status.bad.base#ff5555#ef4444Danger fills
  • color.status.bad.text#ff8585#ba3535Danger text on any surface
  • color.status.info.base#8be9fd#38bdf8Information fills
  • color.status.info.text#8be9fd#1f6a8bInformation text on any surface
  • color.status.live.base#ff5555#ef4444LIVE badges
  • color.status.live.text#ff8585#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