The glow_keep
function applies a glowing effect to the current shape in the Sdf2d
drawing context by blending a specified color with the existing result based on the glow width. This function preserves the current shape and clipping settings while applying the glow effect, allowing you to layer effects without resetting the drawing state.
Sdf2d
instance where the glow effect is applied. The function modifies the result
field of self
in place.vec4
): An RGBA color of the glow.float
): The width of the glow effect. The glow width is scaled according to the current scale_factor
of the drawing context. Larger values produce a more pronounced glow.In this example:
Sdf2d
context using the current position and size of the viewport.(50.0, 50.0)
with a radius of 30.0
.glow_keep
to apply a red glow effect (#f00
) with a width of 10.0
units to the current shape. The glow_keep
function adds a glow around the shape without altering the existing drawing state.fill_keep
to fill the shape with blue color (#00f
) while preserving the shape for further operations if needed.sdf.result
, which contains the final rendered color after all drawing operations.glow_keep
function maintains the current shape and clipping settings, allowing you to apply additional effects or fills afterward.width
parameter is adjusted based on the scale_factor
of the Sdf2d
context, ensuring consistent glow size regardless of transformations._keep
variants of functions, preserving the drawing state between operations.