Random.RandomShade<T>

Extension Method in Random

Declaration

public static Color RandomShade<T>(this Color baseColor, float min = 0F, float max = 1F)
    where T : struct, IComponentModel

Description

Generates a random shade from the base color. The amount of change in the shade can be constrained between a minimum and maximum range if desired.

Type Parameters

TThe type of component model to use.

Parameters

baseColorThe base color to shade.
minThe minimum amount of change in the shade [0..1] (default=0).
maxThe maximum amount of change in the shade [0..1] (default=1).

Returns

ColorA random shade.