private void DoColorSpaceGUI()
{
GUILayout.BeginHorizontal(new GUILayoutOption[0]);
GUILayout.FlexibleSpace();
GUILayoutOption[] options = new GUILayoutOption[] { GUILayout.ExpandWidth(false) };
if (GUILayout.Button(styles.colorCycle, GUIStyle.none, options))
{
this.m_OldColorBoxMode = this.m_ColorBoxMode = (this.m_ColorBoxMode + 1) % ColorBoxMode.EyeDropper;
}
GUILayout.EndHorizontal();
GUILayout.BeginHorizontal(new GUILayoutOption[0]);
GUILayout.Space(20f);
GUILayout.BeginVertical(new GUILayoutOption[0]);
GUILayout.Space(7f);
bool changed = GUI.changed;
GUILayoutOption[] optionArray2 = new GUILayoutOption[] { GUILayout.ExpandHeight(false) };
GUILayout.BeginHorizontal(optionArray2);
GUILayoutOption[] optionArray3 = new GUILayoutOption[] { GUILayout.MinWidth(64f), GUILayout.MinHeight(64f), GUILayout.MaxWidth(256f), GUILayout.MaxHeight(256f) };
Rect boxPos = GUILayoutUtility.GetAspectRect(1f, styles.pickerBox, optionArray3);
EditorGUILayout.Space();
Rect sliderPos = GUILayoutUtility.GetRect(8f, 32f, 64f, 128f, styles.pickerBox);
sliderPos.height = boxPos.height;
GUILayout.EndHorizontal();
GUI.changed = false;
switch (this.m_ColorBoxMode)
{
case ColorBoxMode.SV_H:
this.Slider3D(boxPos, sliderPos, ref this.m_S, ref this.m_V, ref this.m_H, styles.pickerBox, styles.thumb2D, styles.thumbVert);
if (GUI.changed)
{
this.HSVToRGB();
}
break;
case ColorBoxMode.HV_S:
this.Slider3D(boxPos, sliderPos, ref this.m_H, ref this.m_V, ref this.m_S, styles.pickerBox, styles.thumb2D, styles.thumbVert);
if (GUI.changed)
{
this.HSVToRGB();
}
break;
case ColorBoxMode.HS_V:
this.Slider3D(boxPos, sliderPos, ref this.m_H, ref this.m_S, ref this.m_V, styles.pickerBox, styles.thumb2D, styles.thumbVert);
if (GUI.changed)
{
this.HSVToRGB();
}
break;
case ColorBoxMode.BG_R:
this.Slider3D(boxPos, sliderPos, ref this.m_B, ref this.m_G, ref this.m_R, styles.pickerBox, styles.thumb2D, styles.thumbVert);
if (GUI.changed)
{
this.RGBToHSV();
}
break;
case ColorBoxMode.BR_G:
this.Slider3D(boxPos, sliderPos, ref this.m_B, ref this.m_R, ref this.m_G, styles.pickerBox, styles.thumb2D, styles.thumbVert);
if (GUI.changed)
{
this.RGBToHSV();
}
break;
case ColorBoxMode.RG_B:
this.Slider3D(boxPos, sliderPos, ref this.m_R, ref this.m_G, ref this.m_B, styles.pickerBox, styles.thumb2D, styles.thumbVert);
if (GUI.changed)
{
this.RGBToHSV();
}
break;
case ColorBoxMode.EyeDropper:
EyeDropper.DrawPreview(Rect.MinMaxRect(boxPos.x, boxPos.y, sliderPos.xMax, boxPos.yMax));
break;
}
GUI.changed |= changed;
GUILayout.Space(5f);
GUILayout.EndVertical();
GUILayout.Space(20f);
GUILayout.EndHorizontal();
}