Table of Contents

Method GenerateInAffineCircle

Namespace
Gamelogic.Colors
Assembly
Gamelogic.Colors.dll

GenerateInAffineCircle(int, Color, Color, Color, float, float)

Generate colors evenly spaced on a circle transformed by an affine mapping defined by the three given colors.

[Version(2, 1, 0)]
public static List<Color> GenerateInAffineCircle(int colorCount, Color color1, Color color2, Color color3, float radius = 1, float offset = 0)

Parameters

colorCount int

The number of colors to generate.

color1 Color

The color that defines vertex 1 of the affine mapping.

color2 Color

The color that defines vertex 2 of the affine mapping.

color3 Color

The color that defines vertex 3 of the affine mapping.

radius float

The radius of the circle that is transformed. A radius of 1 means the transformed circle will go through the three specified colors in the RGB color space.

offset float

The fraction of revolution to offset the generated colors. 0.5 corresponds to 180 degree. When the offset is 0 and the radius is 1, the first color will correspond to the first color specified.

Returns

List<Color>

A list of generated colors.

Remarks

The three specified colors define a triangle ABC, which are mapped to the equilateral triangle on the unit circle PQR on the XY plane. The affine mapping from PQR to ABC is applied to a circle at the origin, with the specified radius and offset. This results in an ellipse in the color cube, which is where the colors are sampled from.