示例#1
0
 /// <summary>
 /// Unsigned integer overload of <see cref="Cycle(int, ColourCycle)"/>.
 /// </summary>
 /// <param name="number">An indexing value in the colour cycle. May be out of range as it is wrapped.</param>
 /// <param name="cycle">The colour cycle to use.</param>
 /// <returns>A colour from the selected cycle.</returns>
 public static Colour Cycle(uint number, ColourCycle cycle = ColourCycle.StandardCycle)
 {
     return(Cycle((int)number, cycle));
 }
示例#2
0
 /// <summary>
 /// Return a colour from one of the standard <see cref="ColourCycle"/> sets.
 /// </summary>
 /// <param name="number">An indexing value in the colour cycle. May be out of range as it is wrapped.</param>
 /// <param name="cycle">The colour cycle to use.</param>
 /// <returns>A colour from the selected cycle.</returns>
 /// <remarks>
 /// Using this method it is possible to use a monotonic <paramref name="number"/> as
 /// as indexing value. The value is wrapped to the <paramref name="cycle"/> length,
 /// guaranteeing valid colour from the set.
 /// </remarks>
 public static Colour Cycle(int number, ColourCycle cycle = ColourCycle.StandardCycle)
 {
     int[] cycleArray = ColourCycles[(int)cycle];
     return(Colours[cycleArray[number % cycleArray.Length]]);
 }