Back to TPG

TPG.Colors.Contrast

S🏷️ Palette

Part of TPG namespace

TPG.Colors.Contrast(bg)
View on GitHub|gamemode/config/sh_palette.lua:96-99
📋 Has LDoc👁️ 0 viewsUpdated 1 month ago

Description

Black or white, whichever survives on top of the given fill. Standard luminance-weighted formula; ignores bg.a, so a translucent panel fill is judged as if it were opaque against whatever it actually sits on.

Parameters

NameTypeDescription
bgColorThe fill colour text will be drawn over.

Returns

TypeDescription
Color`C.TextDark` on light backgrounds, `C.Text` on dark ones.

Examples

No examples available.

Used In

No usages found in the codebase.