public static Color ColorHSV ();
public static Color ColorHSV (float hueMin, float hueMax);
public static Color ColorHSV (float hueMin, float hueMax, float saturationMin, float saturationMax);
public static Color ColorHSV (float hueMin, float hueMax, float saturationMin, float saturationMax, float valueMin, float valueMax);
public static Color ColorHSV (float hueMin, float hueMax, float saturationMin, float saturationMax, float valueMin, float valueMax, float alphaMin, float alphaMax);

Parámetros

hueMinHue mínimo [0..1].
hueMaxHue máximo [0..1].
saturationMinSaturación mínima [0..1].
saturationMaxMaximum saturation [0..1].
valueMinValor mínimo [0..1].
valueMaxValor máximo [0..1].
alphaMinAlpha mínimo [0..1].
alphaMaxAlpha máximo [0..1].

Valor de retorno

Color A random color with HSV and alpha values in the (inclusive) input ranges. Values for each component are derived via linear interpolation of value.

Descripción

Genera un color aleatorio de rangos HSV y alpha.

using UnityEngine;

public class ColorOnClick : MonoBehaviour { void OnMouseDown() { // Pick a random, saturated and not-too-dark color GetComponent<Renderer>().material.color = Random.ColorHSV(0f, 1f, 1f, 1f, 0.5f, 1f); } }