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

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

/// Charcoal and violet: the colours OpenVibe started with.
public enum VioletHourDarkTokens {
    public static let colorScheme: ColorScheme = .dark
    public static let colorBgBase = Color(.sRGB, red: 0.051, green: 0.051, blue: 0.059, opacity: 1)
    public static let colorBgSurface = Color(.sRGB, red: 0.086, green: 0.086, blue: 0.102, opacity: 1)
    public static let colorBgSubtle = Color(.sRGB, red: 0.118, green: 0.118, blue: 0.141, opacity: 1)
    public static let colorBgRaised = Color(.sRGB, red: 0.102, green: 0.102, blue: 0.125, opacity: 1)
    public static let colorBgHover = Color(.sRGB, red: 0.141, green: 0.141, blue: 0.188, opacity: 1)
    public static let colorBgInput = Color(.sRGB, red: 0.071, green: 0.071, blue: 0.102, opacity: 1)
    public static let colorTextPrimary = Color(.sRGB, red: 0.91, green: 0.902, blue: 0.89, opacity: 1)
    public static let colorTextSecondary = Color(.sRGB, red: 0.604, green: 0.604, blue: 0.604, opacity: 1)
    public static let colorTextMuted = Color(.sRGB, red: 0.553, green: 0.549, blue: 0.549, opacity: 1)
    public static let colorAccentBase = Color(.sRGB, red: 0.545, green: 0.361, blue: 0.965, opacity: 1)
    public static let colorAccentLight = Color(.sRGB, red: 0.655, green: 0.545, blue: 0.98, opacity: 1)
    public static let colorAccentDark = Color(.sRGB, red: 0.427, green: 0.157, blue: 0.851, opacity: 1)
    public static let colorAccentStrong = Color(.sRGB, red: 0.522, green: 0.345, blue: 0.925, 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.545, green: 0.361, blue: 0.965, opacity: 0.35)
    public static let colorLineBase = Color(.sRGB, red: 0.165, green: 0.165, blue: 0.196, opacity: 1)
    public static let colorLineStrong = Color(.sRGB, red: 0.227, green: 0.227, blue: 0.267, opacity: 1)
    public static let colorStatusOkBase = Color(.sRGB, red: 0.18, green: 0.8, blue: 0.443, opacity: 1)
    public static let colorStatusOkText = Color(.sRGB, red: 0.18, green: 0.8, blue: 0.443, opacity: 1)
    public static let colorStatusWarnBase = Color(.sRGB, red: 0.953, green: 0.612, blue: 0.071, opacity: 1)
    public static let colorStatusWarnText = Color(.sRGB, red: 0.953, green: 0.612, blue: 0.071, opacity: 1)
    public static let colorStatusBadBase = Color(.sRGB, red: 0.906, green: 0.298, blue: 0.235, opacity: 1)
    public static let colorStatusBadText = Color(.sRGB, red: 0.914, green: 0.369, blue: 0.314, opacity: 1)
    public static let colorStatusInfoBase = Color(.sRGB, red: 0.204, green: 0.596, blue: 0.859, opacity: 1)
    public static let colorStatusInfoText = Color(.sRGB, red: 0.204, green: 0.596, blue: 0.859, opacity: 1)
    public static let colorStatusLiveBase = Color(.sRGB, red: 0.906, green: 0.298, blue: 0.235, opacity: 1)
    public static let colorStatusLiveText = Color(.sRGB, red: 0.914, green: 0.369, blue: 0.314, opacity: 1)
}

/// Bright white with warm accents.
public enum VioletHourLightTokens {
    public static let colorScheme: ColorScheme = .light
    public static let colorBgBase = Color(.sRGB, red: 1, green: 1, blue: 1, opacity: 1)
    public static let colorBgSurface = Color(.sRGB, red: 0.969, green: 0.969, blue: 0.973, opacity: 1)
    public static let colorBgSubtle = Color(.sRGB, red: 0.933, green: 0.933, blue: 0.941, opacity: 1)
    public static let colorBgRaised = Color(.sRGB, red: 1, green: 1, blue: 1, opacity: 1)
    public static let colorBgHover = Color(.sRGB, red: 0.941, green: 0.941, blue: 0.949, opacity: 1)
    public static let colorBgInput = Color(.sRGB, red: 0.961, green: 0.961, blue: 0.969, opacity: 1)
    public static let colorTextPrimary = Color(.sRGB, red: 0.102, green: 0.102, blue: 0.18, opacity: 1)
    public static let colorTextSecondary = Color(.sRGB, red: 0.29, green: 0.29, blue: 0.416, opacity: 1)
    public static let colorTextMuted = Color(.sRGB, red: 0.408, green: 0.408, blue: 0.482, opacity: 1)
    public static let colorAccentBase = Color(.sRGB, red: 0.478, green: 0.302, blue: 0.859, opacity: 1)
    public static let colorAccentLight = Color(.sRGB, red: 0.447, green: 0.373, blue: 0.667, opacity: 1)
    public static let colorAccentDark = Color(.sRGB, red: 0.427, green: 0.157, blue: 0.851, opacity: 1)
    public static let colorAccentStrong = Color(.sRGB, red: 0.478, green: 0.302, blue: 0.859, 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.478, green: 0.302, blue: 0.859, opacity: 0.35)
    public static let colorLineBase = Color(.sRGB, red: 0.878, green: 0.878, blue: 0.902, opacity: 1)
    public static let colorLineStrong = Color(.sRGB, red: 0.816, green: 0.816, blue: 0.847, 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.082, green: 0.478, blue: 0.227, 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.576, green: 0.373, blue: 0.027, 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.769, green: 0.22, blue: 0.22, 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.133, green: 0.443, blue: 0.584, 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.769, green: 0.22, blue: 0.22, 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#0d0d0f#ffffffThe page behind everything
  • color.bg.surface#16161a#f7f7f8Bands and side panels
  • color.bg.subtle#1e1e24#eeeef0Wells, tracks and quiet fills
  • color.bg.raised#1a1a20#ffffffCards, rows and sheets
  • color.bg.hover#242430#f0f0f2A control under the pointer or finger
  • color.bg.input#12121a#f5f5f7Text fields
  • color.text.primary#e8e6e3#1a1a2eBody text and titles
  • color.text.secondary#9a9a9a#4a4a6aSupporting text
  • color.text.muted#8d8c8c#68687bHints and meta lines
  • color.accent.base#8b5cf6#7a4ddbLinks, icons, focus rings
  • color.accent.light#a78bfa#725faaThe accent a step lighter
  • color.accent.dark#6d28d9#6d28d9The accent a step darker
  • color.accent.strong#8558ec#7a4ddbFilled buttons
  • color.accent.on#ffffff#ffffffText on the accent
  • color.accent.onStrong#ffffff#ffffffText on a filled button
  • color.accent.glowrgba(139,92,246,0.35)rgba(122,77,219,0.35)Glows and halos
  • color.line.base#2a2a32#e0e0e6Dividers and outlines
  • color.line.strong#3a3a44#d0d0d8Outlines that must show
  • color.status.ok.base#2ecc71#22c55eSuccess fills
  • color.status.ok.text#2ecc71#157a3aSuccess text on any surface
  • color.status.warn.base#f39c12#f59e0bWarning fills
  • color.status.warn.text#f39c12#935f07Warning text on any surface
  • color.status.bad.base#e74c3c#ef4444Danger fills
  • color.status.bad.text#e95e50#c43838Danger text on any surface
  • color.status.info.base#3498db#38bdf8Information fills
  • color.status.info.text#3498db#227195Information text on any surface
  • color.status.live.base#e74c3c#ef4444LIVE badges
  • color.status.live.text#e95e50#c43838LIVE 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