Table of Contents

Method WithBrightness

Namespace
Gamelogic.Extensions
Assembly
Gamelogic.Extensions.dll

WithBrightness(Color, float)

Returns a new color with the RGB values scaled so that the color has the given brightness.

public static Color WithBrightness(this Color color, float brightness)

Parameters

color Color
brightness float

Returns

Color

Remarks

If the color is too dark, a grey is returned with the right brightness. The alpha is left unchanged.