Method GenerateInAffineCircle
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
intThe number of colors to generate.
color1
ColorThe color that defines vertex 1 of the affine mapping.
color2
ColorThe color that defines vertex 2 of the affine mapping.
color3
ColorThe color that defines vertex 3 of the affine mapping.
radius
floatThe 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
floatThe 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
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.