hueMin | 最低色相 [0..1] |
hueMax | 最高色相 [0..1] |
saturationMin | 最低彩度 [0..1] |
saturationMax | Maximum saturation [0..1]. |
valueMin | 最小値 [0..1] |
valueMax | 最大値 [0..1] |
alphaMin | 最低アルファ [0..1] |
alphaMax | 最高アルファ [0..1] |
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.
HSV で アルファ値を持つランダムな色を生成します。
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); } }