Colours

Colour tables, groups, relationships and notes in schema code with headercolor and color.

A table takes headercolor. A group, a Ref: line and a note take color. Each takes a hex colour, #RGB or #RRGGBB.

Table customers [headercolor: #3498DB] {
  id integer [pk, increment]
}

Table orders {
  id integer [pk, increment]
  customer_id integer [not null]
}

Ref: orders.customer_id > customers.id [color: #E74C3C]

TableGroup sales [color: #27AE60] {
  customers
  orders
}

Note billing_rules [color: #F1C40F] {
  'Invoices are issued when an order ships.'
}

dbdiagram.io writes the same settings, so a schema coloured there keeps its colours here. To take a colour off, delete the setting. To colour without writing code, see Colour.

How each element is coloured

  • A table's header is washed in the colour, with a strip of it along the top. A note is drawn the same way.
  • A group's frame is drawn in the colour, with a wash inside it.
  • A relationship's line and its end marks are drawn in the colour.
  • Columns have no colour.

The eight colours

The app offers eight colours:

ColourHex
Red#E74C3C
Orange#E67E22
Yellow#F1C40F
Green#27AE60
Blue#3498DB
Purple#8E44AD
Pink#E84393
Grey#7F8C8D

Any other hex colour in the code is drawn as it is.

Schema code takes hex only, because DBML has no colour names. So headercolor: green is refused. The assistant and the canvas take the names.

Enum colours

An enum is coloured like a table. But DBML doesn't allow settings on an Enum, so its colour isn't written in the code.

The app keeps the colour anyway. It stays when you edit the code or ask the assistant for a change. A .dbml download leaves it out, and tells you how many it left out.

On this page