rgbColor | An input color. |
H | Output variable for hue. |
S | Output variable for saturation. |
V | Output variable for value. |
Calculates the hue, saturation and value of an RGB input color.
#pragma strict // Display an RGBA as an HSV public class ExampleScript extends MonoBehaviour { function Start() { var HSV: float; Color.RGBToHSV(new Color(0.9f, 0.7f, 0.1f, 1.0F), H, S, V); Debug.Log("H: " + H + " S: " + S + " V: " + V); } }
using UnityEngine;
// Display an RGBA as an HSV
public class ExampleScript : MonoBehaviour { void Start() { float H, S, V;
Color.RGBToHSV(new Color(0.9f, 0.7f, 0.1f, 1.0F), out H, out S, out V); Debug.Log("H: " + H + " S: " + S + " V: " + V); } }