---
title: "Enhancing Your Model's Visual Quality - Color themes"
canonical: "https://help.twinfinity.com/space/HCFD/142180441/Enhancing%20Your%20Model's%20Visual%20Quality%20-%20Color%20themes"
format: markdown
---
IFC models arrive from many sources — different contractors, different authoring software, different
disciplines — and each tends to carry its own colour scheme. Left as-is, the result is a patchwork that
makes a model harder to read. Overriding those colours with one consistent theme of your own gives users a
cohesive, intuitive experience and a much faster path to understanding what they're looking at. A theme
tailored to your business also lifts the overall visual quality of your Twinfinity apps.

The sections below cover three ways to apply a theme, from class-based accents to a full-model grade.

## Colouring objects by class

The most common approach is to colour objects by what they are. Iterate the model with
`api.ifc.foreach` and use `o.class.is(...)` to match either a logical group (like `'walls'` or
`'windows'`) or a specific IFC class id (like `'IfcDoor'`) when no group fits. Colours are RGB in the
`0-255` range, set with `o.setColor([r, g, b])`.

```ts
// Accent a few classes in grey, give everything else a light base,
// and leave windows with their original colour.
const accentClasses = ['IfcDoor', 'IfcRoof', 'IfcColumn'] as const;
const accentColor = [180, 180, 180]; // Grey
const baseColor = [240, 240, 240];   // Light grey

api.ifc.foreach((o) => {
  if (o.class.is('windows')) {
    return; // keep windows as authored
  } else if (accentClasses.some((ifcClass) => o.class.is(ifcClass))) {
    o.setColor(accentColor);
  } else {
    o.setColor(baseColor);
  }
});
```

See it in the playground: [Colour objects by class](https://playground.twinfinity.dev/?pgId=colour/object-colors).

## Colouring by a property

Class isn't the only thing you can theme by. You can also read an object's properties and colour
accordingly — for example, giving every room a colour derived from its name. This is great for legends,
zoning, and any view where you want related spaces to stand out together.

See it in the playground: [Colour rooms by name](https://playground.twinfinity.dev/?pgId=colour/rooms-by-name).

## A whole-model HSV grade

When you want a uniform look rather than per-object accents, apply a grade across the entire model in
HSV space. Shifting hue, saturation, and value together keeps the result harmonious while still letting
the underlying geometry read clearly.

See it in the playground: [HSV colour grading](https://playground.twinfinity.dev/?pgId=colour/hsv-grading).

## Going further

Colour isn't limited to opaque overrides — making selected objects transparent (ghosting) is a useful way
to de-emphasise context while keeping it visible.

See it in the playground: [Transparency (ghosting)](https://playground.twinfinity.dev/?pgId=colour/transparency).

Combine these techniques to build a theme that fits your application and gives users a consistent,
legible view of every model you load.