Skip to main content

color-changing-cover

Cover content by forcing every colour to one flat colour.

A compiler-light alternative to alpha-changing-cover: it overwrites colours rather than reading them, so it makes no context call.

Example: config-methods(cover: utils.color-changing-cover.with(color: gray))

Parameters

color : color    default: gray​

The colour to force on covered content. Default is gray.

fallback-for-filled : bool    default: true​

Whether an element that paints its own background is handed to fallback-hide instead of being recoloured. Flattening such an element and the content on top of it to a single colour would leave the content unreadable, so this defaults to true. Set it to false to recolour them like everything else. Applies to images, rect, ... so that content is still visible.

fallback-hide : func    default: auto​

Applied to what cannot be recoloured, such as images, and to filled elements while fallback-for-filled is on. auto overlays them so they dim to match the recoloured text instead of disappearing. Pass none to leave them untouched.

fallback-hide-args : dict    default: (:)​

Extra named arguments for fallback-hide.

it : content​

The content to cover.

Returns: content