void OnModeChanged() { switch (m_LocalMode) { case ColorPickerMode.SL_H_Triangle: case ColorPickerMode.SV_H_Rect: ColorPickerUtils.MakeRamp(m_LocalMode, m_Width, m_Height, m_tempColors); m_sliderTex.SetPixels(m_tempColors); m_sliderTex.Apply(); break; case ColorPickerMode.HL_S_Polar: case ColorPickerMode.HS_L_Polar: case ColorPickerMode.HS_LogV_Polar: // Texture updates when color updates break; default: Debug.Assert(false); break; } }
// Notification from sibling objects in the color picker UI that // the color has changed. // TODO: make this a no-op when color changes on the slider's axis? // Caller is responsible for guaranteeing that "mode+raw" maps to a valid color. public void OnColorChanged(ColorPickerMode mode, Vector3 raw) { ColorPickerUtils.MakeRamp(mode, m_Width, m_Height, m_tempColors, raw); m_sliderTex.SetPixels(m_tempColors); m_sliderTex.Apply(); }