Documentation

LED bars

Chop a bar into blocks and colour the lit ones by the load.

LED bars: the urdeck.widgets.stats widget at 4x2.
The urdeck.widgets.stats widget at 4x2, drawn by UrDeck from this theme.

The theme

This is the theme.json of the recipe, exactly as it is in the repository (site/cookbook/led-bars/). Save it as themes/my-theme/theme.json next to UrDeck.Host.exe and set "theme": "my-theme", or copy the keys you like into your own theme.

{
  "$schema": "https://urdeck.app/schemas/v1/theme.json",
  "meta": {
    "name": "LED bars",
    "description": "Bars cut into lit blocks that turn from green to red with the load.",
    "mode": "dark"
  },
  "colors": {
    "cardFill": "#10121c",
    "ramp": ["#3ddc84", "#ffb020", "#ff5a4d"]
  },
  "stroke": { "thickness": 0.12, "cap": "square" },
  "gauge": {
    "style": "bar",
    "colorBy": "ramp",
    "segments": { "length": 0.035, "gap": 0.012 },
    "track": { "color": "#1affffff" }
  }
}

How it works

Three keys make an LED meter out of a plain bar.

  • gauge.style bar is what a widget gets when it asks for “the theme’s gauge” and nothing more specific. A widget that sets its own style on a slot still wins.
  • gauge.segments cuts the fill into blocks: length along the bar (a fraction of a cell, for a ring the arc length in cells) and gap between blocks. The track is cut the same way, so unlit blocks show.
  • gauge.colorBy ramp colours the fill by its value along colors.ramp instead of the accent, warning and critical steps. The ramp has two to five colours from low to high; the default is good, warning, critical.

stroke.thickness makes the bar taller and stroke.cap square gives the line blunt ends. gauge.track.color is the unlit block colour. Add gauge.valueTint true to colour the number like the fill. For a zone that lights in a colour of its own, see the tach recipe.

All recipes · Theme reference