本文整理汇总了C#中UnityEngine.Color.Brightness方法的典型用法代码示例。如果您正苦于以下问题:C# Color.Brightness方法的具体用法?C# Color.Brightness怎么用?C# Color.Brightness使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UnityEngine.Color
的用法示例。
在下文中一共展示了Color.Brightness方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SCANuiColorPicker
internal SCANuiColorPicker (Color low, Color high, bool changeLow)
{
colorLow = c= low;
c = colorLow.maxBright();
colorHigh = high;
lowColorChange = oldColorState = changeLow;
valSlider = oldValSlider = colorLow.Brightness().Mathf_Round(2) * 100f;
}
示例2: GenerateRandomWalk
/**
Generates a sequence of colors where the next color is a random offset from the previous color.
@param colorCount The number of colors to generate
@param startColor The first color in the sequence
@param
*/
public static List<Color> GenerateRandomWalk(
int colorCount,
Color startColor,
float minOffset,
float maxOffset,
bool fixLightness)
{
var colors = new List<Color>();
var newColor = startColor;
for (int i = 0; i < colorCount; i++)
{
var amplitude = minOffset + (maxOffset - minOffset) * Random.value;
var offset = amplitude * Random.onUnitSphere;
newColor = new Color(
Mathf.Clamp01(newColor.r + offset.x),
Mathf.Clamp01(newColor.g + offset.y),
Mathf.Clamp01(newColor.b + offset.z));
colors.Add(newColor);
}
if (fixLightness)
{
var brightness = startColor.Brightness();
return colors.Select(color => color.WithBrightness(brightness)).ToList();
}
return colors;
}