contrasting_foreground_color


Description:


public RGBA contrasting_foreground_color (RGBA bg_color)

Takes a Gdk.RGBA background color and returns a suitably-contrasting foreground color, i.e. for determining text color on a colored background. There is a slight bias toward returning white, as white generally looks better on a wider range of colored backgrounds than black.

Parameters:

bg_color

any Gdk.RGBA background color

Returns:

a contrasting Gdk.RGBA foreground color, i.e. white ({ 1.0, 1.0, 1.0, 1.0}) or black ({ 0.0, 0.0, 0.0, 1.0}).


Namespace: Granite
Package: granite



2022 vala-language.org