class_name ColorTools
## Toolkit for working with colors

const DEFAULT_LUM_THRESHOLD := 0.179


## Selects an appropriate background color for the given foreground color.
##
## Options are white or black.
static func get_bg_color(fg_color: Color, threshold: float = DEFAULT_LUM_THRESHOLD) -> Color:
	return Color.BLACK if fg_color.srgb_to_linear().get_luminance() > threshold else Color.WHITE
