Skip to content
pixi-silk
GitHub repository
Interface

GlassStyle

import type { GlassStyle } from 'pixi-silk/glass';

How a Glass pane looks. Distances are in local units and scale with the pane’s transform. Every field is optional. resolveGlass fills in GLASS_DEFAULTS and clamps the ranges.

Extended by#

Properties#

PropertyTypeDescriptionDefined in
bevel?numberWidth of the curved rim that refracts, in local units, at least 1. Default 22.glass/options.ts:20
blur?numberBackdrop blur radius in local units, at least 0. Default 18.glass/options.ts:14
dispersion?numberColour split at the rim, 0 to 1. Default 0.35.glass/options.ts:18
frost?numberMilky whitening, 0 to 1. Default 0.06.glass/options.ts:22
grain?numberFilm grain amount, at least 0. Default 0.035.glass/options.ts:36
light?numberStrength of the sheen and the lit rim, at least 0. Default 0.8.glass/options.ts:34
lightAngle?numberDirection the light comes from, in radians. 0 is right, -PI/2 is top. Default -3PI/4 (top left).glass/options.ts:32
opacity?numberOpacity of the glass and its shadow, 0 to 1. Default 1.glass/options.ts:30
radius?numberCorner radius in local units, at least 0. Default 28.glass/options.ts:10
refraction?numberHow far the rim shifts what is behind it, in local units. Negative bends the other way. Default 14.glass/options.ts:16
saturation?numberSaturation of what shows through, at least 0. 1 keeps it, 0 is grey, above 1 is more vivid. Default 1.2.glass/options.ts:24
shadow?numberOpacity of the soft drop shadow under the pane, 0 to 1. 0 turns it off. Default 0.3.glass/options.ts:38
smoothing?numberSquircle smoothing of the corners, 0 (circular arcs) to 1. Default 0.6.glass/options.ts:12
tint?ColorSourceTint colour, any Pixi colour source. Default white.glass/options.ts:26
tintAmount?numberHow much tint to mix in, 0 to 1. Default 0.04.glass/options.ts:28