private void SetColor(Color c)
{
if (this.m_IsOSColorPicker)
{
OSColorPicker.color = c;
}
else
{
float hDRScaleFactor = this.m_HDRValues.m_HDRScaleFactor;
if (this.m_HDR)
{
float maxColorComponent = c.maxColorComponent;
if (maxColorComponent > 1f)
{
c = c.RGBMultiplied((float) (1f / maxColorComponent));
}
this.SetHDRScaleFactor(Mathf.Max(1f, maxColorComponent));
}
if ((((this.m_Color.r != c.r) || (this.m_Color.g != c.g)) || ((this.m_Color.b != c.b) || (this.m_Color.a != c.a))) || (hDRScaleFactor != this.m_HDRValues.m_HDRScaleFactor))
{
if (((c.r > 1f) || (c.g > 1f)) || (c.b > 1f))
{
Debug.LogError(string.Format("Invalid normalized color: {0}, normalize value: {1}", c, this.m_HDRValues.m_HDRScaleFactor));
}
this.m_resetKeyboardControl = true;
this.SetNormalizedColor(c);
base.Repaint();
}
}
}