Table of Contents

Class ColorExtensions

Namespace
Gamelogic.Extensions
Assembly
Gamelogic.Extensions.dll

Provides some utility functions for Colors.

[Version(1, 0, 0)]
public static class ColorExtensions
Inheritance
ColorExtensions
Inherited Members

Methods

Brightness(Color)

Returns the brightness of the color, defined as the average off the three color channels.

Darker(Color)

Returns a color darker than the given color.

Invert(Color)

Returns a new color that is this color inverted.

IsApproximatelyBlack(Color)

Returns whether the color is black or almost black.

IsApproximatelyWhite(Color)

Returns whether the color is white or almost white.

Lighter(Color)

Returns a color lighter than the given color.

Opaque(Color)

Returns an opaque version of the given color.

WithAlpha(Color, float)

Returns the same color, but with the specified alpha.

WithBrightness(Color, float)

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