GlowEffectLib — Outer Glow Effect
Creates a luminous aura around any visual control. GPU-accelerated outer glow that radiates outwards from the control’s edges. Wraps FireMonkey’s TGlowEffect. Perfect for neon UIs, selection highlighting, hover feedback, and sci-fi aesthetics. 17 functions.
| Category | Count | Description |
|---|---|---|
| Error Handling | 4 | glow_error, errormsg$, strerror$, clearerror |
| Creation & Destruction | 2 | glow# (create), glow_free (destroy) |
| Properties | 7 | softness (2), color (3), opacity (2) |
| Effect Control | 4 | enabled, trigger (get/set) |
glow_color# sets by string, glow_color$ gets as string, and glow_color gets as numeric ARGB value.Outer Glow vs Inner Glow
| Feature | GlowEffectLib (Outer) | InnerGlowEffectLib |
|---|---|---|
| Direction | Outward — radiates beyond edges | Inward — fills inside edges |
| Visual | Luminous halo/aura | Inner border glow |
| Best for | Neon buttons, selection, hover | Embossed panels, inset effects |
| Functions | 17 | 16 |
Default Values
| Property | Range | Default | Description |
|---|---|---|---|
| Softness | 0.0–9.0 | 4.0 | Glow spread/blur radius |
| GlowColor | Color name / hex | Yellow | Glow colour |
| Opacity | 0.0–1.0 | 0.9 | Glow intensity |
Cross-Platform Support
| Platform | Status | Notes |
|---|---|---|
| Windows | ✅ Full Support | GPU-accelerated via Direct2D |
| Linux | ✅ Full Support | Software rendering fallback |
| Android | ✅ Full Support | GPU-accelerated |
Error Handling
| Function | Signature | Description |
|---|---|---|
glow_error() | glow_error@ | Returns last error code (0 = no error) |
glow_errormsg$() | glow_errormsg$@ | Returns last error message |
glow_strerror$(code) | glow_strerror$@n | Converts error code to text |
glow_clearerror() | glow_clearerror@ | Clears error state |
Error Codes
| Code | Constant | Meaning |
|---|---|---|
| 0 | ERR_NONE | No error |
| 1 | ERR_NIL_EFFECT | Effect pointer is nil |
| 2 | ERR_INVALID_EFFECT | Not a valid TGlowEffect |
| 3 | ERR_INVALID_VALUE | Property value out of range |
| 4 | ERR_NIL_PARENT | Parent control is nil |
| 5 | ERR_INVALID_PARENT | Not a valid TFmxObject |
| 6 | ERR_INVALID_COLOR | Unrecognised colour name/hex |
Creation & Destruction
| Function | Signature | Description |
|---|---|---|
glow#(parent#) | glow#@# | Creates outer glow on parent. Returns effect pointer. Defaults: softness 4.0, color Yellow, opacity 0.9 |
glow_free(effect#) | glow_free@# | Destroys effect, removes from parent |
Softness
Controls glow spread/blur radius. Range 0.0–9.0.
| Function | Signature | Description |
|---|---|---|
glow_softness#(effect#, value) | glow_softness#@#n | Sets softness (0.0–9.0) |
glow_softness(effect#) | glow_softness@# | Gets current softness |
| Range | Effect | Use Case |
|---|---|---|
| 0.0–2.0 | Tight glow, close to edge | Subtle highlight, thin border glow |
| 2.0–5.0 | Normal glow spread | General purpose, neon buttons |
| 5.0–9.0 | Wide, diffuse glow | Dramatic aura, ambient lighting |
Color
Glow colour accepts named colours or hex strings. Three functions: set (string), get as string, get as number.
| Function | Signature | Description |
|---|---|---|
glow_color#(effect#, color$) | glow_color#@#$ | Sets glow colour (name or hex string) |
glow_color$(effect#) | glow_color$@# | Gets colour as string |
glow_color(effect#) | glow_color@# | Gets colour as numeric ARGB value |
Supported named colours: Black, White, Red, Green, Blue, Yellow, Cyan, Magenta, Gray, Grey, Silver, Maroon, Olive, Navy, Purple, Teal, Orange, Pink, Brown, Lime, Aqua, Fuchsia, Transparent, Null
Hex format: #RRGGBB or #AARRGGBB (e.g. "#00FFFF" for cyan, "#8000FF00" for 50% transparent green)
Opacity
| Function | Signature | Description |
|---|---|---|
glow_opacity#(effect#, value) | glow_opacity#@#n | Sets opacity (0.0–1.0) |
glow_opacity(effect#) | glow_opacity@# | Gets current opacity |
| Range | Effect |
|---|---|
| 0.0 | Invisible (glow hidden) |
| 0.3–0.5 | Subtle, understated glow |
| 0.6–0.8 | Normal glow intensity |
| 0.9–1.0 | Intense, vivid glow |
Effect Control
| Function | Signature | Description |
|---|---|---|
glow_enabled#(effect#, value) | glow_enabled#@#n | Enables (1) or disables (0) |
glow_enabled(effect#) | glow_enabled@# | Gets enabled state |
glow_trigger#(effect#, trigger$) | glow_trigger#@#$ | Sets trigger (e.g. "IsMouseOver=true") |
glow_trigger$(effect#) | glow_trigger$@# | Gets trigger string |
Complete Examples
Neon Button
let frm# = form#("Neon Button", 400, 250) ' Dark background let bg# = rectangle#(frm#) rectangle_bounds#(bg#, 0, 0, 400, 250) rectangle_fill#(bg#, "#1a1a2e") ' Neon button let btn# = rectangle#(bg#) rectangle_bounds#(btn#, 125, 90, 150, 50) rectangle_fill#(btn#, "#1a1a2e") rectangle_stroke#(btn#, "Cyan") rectangle_strokethickness#(btn#, 2) rectangle_corners#(btn#, 8, 8) let lbl# = label#(btn#, "NEON", 55, 15) label_fontcolor#(lbl#, "White") ' Cyan glow let glow# = glow#(btn#) glow_color#(glow#, "Cyan") glow_softness#(glow#, 5.0) glow_opacity#(glow#, 0.9) form_show(frm#)
Neon Button Gallery
let frm# = form#("Neon Gallery", 500, 200) let bg# = rectangle#(frm#) rectangle_bounds#(bg#, 0, 0, 500, 200) rectangle_fill#(bg#, "#0d0d0d") CreateNeonBtn(bg#, 30, 70, "PLAY", "Lime") CreateNeonBtn(bg#, 140, 70, "STOP", "Red") CreateNeonBtn(bg#, 250, 70, "INFO", "Cyan") CreateNeonBtn(bg#, 360, 70, "WARN", "Orange") form_show(frm#) function CreateNeonBtn(parent#, x, y, text$, color$) local btn#, lbl#, glow# btn# = rectangle#(parent#) rectangle_bounds#(btn#, x, y, 90, 40) rectangle_fill#(btn#, "#0d0d0d") rectangle_stroke#(btn#, color$) rectangle_strokethickness#(btn#, 2) rectangle_corners#(btn#, 5, 5) lbl# = label#(btn#, text$, 25, 10) label_fontcolor#(lbl#, "White") glow# = glow#(btn#) glow_color#(glow#, color$) glow_softness#(glow#, 4.0) glow_opacity#(glow#, 0.8) endfunction
Hover Glow Cards
let frm# = Pointer#(0) let card1# = Pointer#(0) let card2# = Pointer#(0) let glow1# = Pointer#(0) let glow2# = Pointer#(0) frm# = form#("Hover Glow Cards", 450, 250) let info# = label#(frm#, "Hover over the cards:", 30, 20) ' Card 1 card1# = rectangle#(frm#) rectangle_bounds#(card1#, 50, 70, 150, 100) rectangle_fill#(card1#, "White") rectangle_corners#(card1#, 8, 8) glow1# = glow#(card1#) glow_color#(glow1#, "DodgerBlue") glow_softness#(glow1#, 5.0) glow_enabled#(glow1#, 0) rectangle_onmouseenter#(card1#, "Card1Enter") rectangle_onmouseleave#(card1#, "Card1Leave") let lbl1# = label#(card1#, "Card 1", 50, 40) label_hittest#(lbl1#, 0) ' Card 2 card2# = rectangle#(frm#) rectangle_bounds#(card2#, 250, 70, 150, 100) rectangle_fill#(card2#, "White") rectangle_corners#(card2#, 8, 8) glow2# = glow#(card2#) glow_color#(glow2#, "LimeGreen") glow_softness#(glow2#, 5.0) glow_enabled#(glow2#, 0) rectangle_onmouseenter#(card2#, "Card2Enter") rectangle_onmouseleave#(card2#, "Card2Leave") let lbl2# = label#(card2#, "Card 2", 50, 40) label_hittest#(lbl2#, 0) form_show(frm#) function Card1Enter(sender#) glow_enabled#(glow1#, 1) endfunction function Card1Leave(sender#) glow_enabled#(glow1#, 0) endfunction function Card2Enter(sender#) glow_enabled#(glow2#, 1) endfunction function Card2Leave(sender#) glow_enabled#(glow2#, 0) endfunction
Animatable Properties
Both Softness and Opacity can be animated with FloatAnimationLib for pulsing glow effects:
' Pulsing glow on a circle let ani# = floatani#(glow#) floatani_propertyname#(ani#, "Softness") floatani_startvalue#(ani#, 2.0) floatani_stopvalue#(ani#, 8.0) floatani_duration#(ani#, 0.8) floatani_autoreverse#(ani#, 1) floatani_loop#(ani#, 1) floatani_interpolation#(ani#, "Sinusoidal") floatani_animationtype#(ani#, "InOut") floatani_start(ani#)
Best Practices
| Practice | Why |
|---|---|
| Use dark backgrounds for neon | Glow stands out best on dark surfaces |
| Softness 4–5 for general use | Good balance of visible glow without heavy rendering |
| Softness >7 on mobile with caution | Very wide glow can impact performance on mobile GPUs |
Use glow_enabled# for hover | Toggle via mouse events for interactive feedback |
| Match glow colour to border | Creates cohesive neon look when stroke and glow match |
| Animate with FloatAnimationLib | Sinusoidal pulse on Softness creates natural breathing effect |
Use label_hittest#(lbl#, 0) | Prevents labels inside glowing controls from stealing mouse events |
Quick Reference
| Function | Signature | Description |
|---|---|---|
| ERROR HANDLING | ||
glow_error() | glow_error@ | Last error code |
glow_errormsg$() | glow_errormsg$@ | Last error message |
glow_strerror$(code) | glow_strerror$@n | Error code to text |
glow_clearerror() | glow_clearerror@ | Clear error state |
| CREATION & DESTRUCTION | ||
glow#(parent#) | glow#@# | Create outer glow on control |
glow_free(effect#) | glow_free@# | Destroy effect |
| SOFTNESS | ||
glow_softness#(e#, val) | glow_softness#@#n | Set spread (0–9) |
glow_softness(e#) | glow_softness@# | Get spread |
| COLOR | ||
glow_color#(e#, color$) | glow_color#@#$ | Set colour (name/hex) |
glow_color$(e#) | glow_color$@# | Get colour as string |
glow_color(e#) | glow_color@# | Get colour as ARGB number |
| OPACITY | ||
glow_opacity#(e#, val) | glow_opacity#@#n | Set opacity (0–1) |
glow_opacity(e#) | glow_opacity@# | Get opacity |
| EFFECT CONTROL | ||
glow_enabled#(e#, val) | glow_enabled#@#n | Enable (1) / disable (0) |
glow_enabled(e#) | glow_enabled@# | Get enabled state |
glow_trigger#(e#, str$) | glow_trigger#@#$ | Set trigger string |
glow_trigger$(e#) | glow_trigger$@# | Get trigger string |
17 functions. Part of the Plan9Basic visual effects library system.
See Also
- InnerGlowEffectLib — Glow inside control boundaries
- ShadowEffectLib — Drop shadow effects
- BlurEffectLib — Blur effects
- FloatAnimationLib — Animate glow Softness and Opacity
