Skip to content

Outline Styles

Moth edited this page Aug 9, 2026 · 1 revision

Outline Styles

OutlineStyle controls how Butterfly API outlines are rendered.

A style can configure:

  • Color
  • Thickness
  • Placement
  • Black border
  • Visibility through walls
  • Model-layer matching
  • Distance-consistent thickness

Basic Style

The simplest style can be created with:

OutlineStyle style =
        OutlineStyle.of("#FFFFFF");

You can also use the builder for more control:

OutlineStyle style =
        OutlineStyle.builder("#FFFFFF")
                .thickness(2)
                .placement(
                        OutlinePlacement.CENTERED
                )
                .blackBorder(false)
                .visibleThroughWalls(true)
                .matchModelLayer(true)
                .consistentThickness(true)
                .build();

Colors

Outline colors use RGB values.

Hex strings can be used:

OutlineStyle.of("#FFFFFF");

Colors can also be represented as RGB integers:

0xFFFFFF

Thickness

Set outline thickness with:

.thickness(2)

Thickness is measured in pixels.

Valid thickness values are:

1 - 63

Placement

Outline placement controls where the outline expands relative to the rendered shape.

Available placements are:

OutlinePlacement.CENTERED
OutlinePlacement.OUTSIDE
OutlinePlacement.INSIDE

Example:

.placement(
        OutlinePlacement.OUTSIDE
)

Black Border

Enable a black border with:

.blackBorder(true)

When black borders are enabled, supported outline thickness is limited to:

22 pixels

Visible Through Walls

Use:

.visibleThroughWalls(true)

when the outline should remain visible through depth.

Disable it with:

.visibleThroughWalls(false)

when normal depth should hide the outline.

Match Model Layer

Use:

.matchModelLayer(true)

when an outline mask should follow the source renderer's model layer.

This is especially useful for cutout or translucent rendering.

Example:

OutlineStyle style =
        OutlineStyle.builder("#FFFFFF")
                .matchModelLayer(true)
                .build();

Consistent Thickness

Use:

.consistentThickness(true)

to keep the requested outline width visually stable across distance.

Complete Example

OutlineStyle questStyle =
        OutlineStyle.builder("#66CCFF")
                .thickness(3)
                .placement(
                        OutlinePlacement.OUTSIDE
                )
                .blackBorder(false)
                .visibleThroughWalls(true)
                .matchModelLayer(true)
                .consistentThickness(true)
                .build();

This style can then be used with either server or client outlines.

Related Pages

Clone this wiki locally