Dashboards

Conditions and colours

Make a widget change with a value: a colour that slides with a temperature, a delta that turns red, a fuel warning that blinks, a lamp that lights for a flag.

Each widget watches one field — not necessarily the one it shows, so a gear readout can turn red on engine.rpm_percent — and reads it against a colour ramp, up to four rules, or both. Bringing a whole page up on an event is a slot’s job, in Screens and pages.

How it fits together

  • The colour ramp is the bottom layer: one colour that slides with the value between up to four stops.
  • The rules come on top: the first rule that holds restyles the widget — colours, hidden, blinking — over the ramp.
  • While the watched field has no value, no ramp paints and no rule holds: the widget looks the way you designed it.

Choose what to watch

The watched value is always read as a number. A true-or-false field reads 1 or 0, and its rules offer equal and not_equal against true or false; switching Watch to such a field turns the rules you have into that form. A text field counts only while it holds a plain number, such as a fuel estimate 4.2: a word such as session.flag.current never matches anything.

Colour ramps

Add a colour ramp starts with two stops, green at 0 and red at 1, so for a temperature or a percentage change the stop values first. Stop values are in the watched field’s unit, and each must be above the one before. One stop alone is not a ramp: the configurator cannot save it.

Rules

The threshold in When is in the watched field’s unit.

FieldWhat it does
ValueThe content colour: the text of a text widget, the fill of a bar or an arc, every line of a graph, the tint of an image. A shape and a Lights widget have no content, so it does nothing there.
BackgroundA widget with a background gradient keeps the gradient and changes its first colour.
BorderIt shows only on a box with a border width.
Blink (ms)100 to 5000 is one full on-off cycle: shown for the first half, hidden for the second. The whole widget flashes — box, caption and value together. A number from 1 to 99 becomes 100.
Hold (ms)Keeps the rule applied for this long after it stops holding, so a moment too short to see stays readable. The hold starts again each time the rule holds again.

equal means exactly the threshold: use it for levels, counts and true-or-false, not for values with decimals. bit_set is offered only for input.buttons: it holds while the button with that number, 1 to 16, is held. See Buttons.

Which rule wins

Rules are read from the top, and the first one that holds styles the widget; the rest are ignored, they never add up. Whatever that rule leaves unticked stays as designed, or as the ramp paints it. So put the most urgent rule first: at_or_above 97 above at_or_above 92, or the 92 rule would win at 98 as well. Rules cannot be dragged into another order: change their values, or remove them with the bin and add them again.

A rule cannot clear a colour it did not set: an unticked colour keeps the widget’s own. For a box that should only light up on an event, give it no background and let the rule paint one.

Examples

A delta that is green when you gain and red when you lose

  1. 1
    Draw a Text widget. In Source 1, choose session.lap.delta_best and set Transform to signed_duration_ms. It reads -0.245 while you are 0.245 seconds up on your fastest lap.
  2. 2
    Under Value, set Colour to a green, such as #2FE85A: the colour while you gain.
  3. 3
    In Conditions, set Watch to the same field, session.lap.delta_best.
  4. 4
    Press Add rule. In When, choose above and type 0 — the field counts milliseconds.
  5. 5
    Tick Value and pick a red, such as #FF3B6B. While you lose time the text is red; at exactly 0 it stays green.

For a colour that deepens with the gap instead, use a ramp: stops at −500 green, 0 white and 500 red, painting content.

  1. 1
    Draw a Text widget that shows vehicle.fuel.laps_remaining, the laps of fuel left, such as 4.2.
  2. 2
    In Conditions, set Watch to vehicle.fuel.laps_remaining.
  3. 3
    Add a rule: at_or_below 2. Tick Background, pick a dark red, and set Blink (ms) to 800.
  4. 4
    Add a second rule: at_or_below 3. Tick Value and pick amber.
  5. 5
    With 2.5 laps left only the second rule holds and the number turns amber. Below 2 both hold, the first one wins, and the whole box blinks.

To warn only when you should stop, watch vehicle.fuel.pit_now instead: it is true from 80 % of a lap when at most 1.1 laps of fuel are left, after the first lap and outside the pits. Use equal true.

A flag lamp

  1. 1
    Draw a Shape where the lamp goes and untick its Background, so nothing shows until a rule paints it.
  2. 2
    In Conditions, set Watch to session.flag.yellow.
  3. 3
    Add a rule: equal true. Tick Background and pick yellow. Set Hold (ms) to 2000 if a flag waved for an instant should stay readable.
  4. 4
    For a blue flag, duplicate the shape with Ctrl+D or Cmd+D and move the copy back onto the same spot (it lands 8 px away). Set its Watch to session.flag.blue and pick blue. The stacked shapes paint only for the flags that are out.

Good to know

  • A rule’s Value colour on a bar with a gradient changes only the gradient’s first colour; on an arc with a gradient it paints the ring in one flat colour until the rule lets go.
  • The Blink of a Lights widget counts differently: there the period is how long each lamp stays on and how long it stays off, so a full cycle takes twice as long. A rule’s Blink (ms) is the whole cycle.
  • A ramp or a rule needs a Watch field: without one the configurator cannot save.

Limits

WhatLimit
Watched fields per widget1
Rules per widget4
Stops in a colour ramp2 to 4
Blink (ms)0, or 100 to 5000
Hold (ms)0 to 10000