/// <summary> /// Sets the initial color of the display, and the ColorPickerUI that is /// changing colors. /// </summary> /// <param name="pickerUI">The UI that asked to show the display.</param> public void ShowDisplay(ColorPickerUI pickerUI) { SelectingUI = pickerUI; ColorDisplay.color = SelectingUI.GetJSONColor().GetColor(); RedSelection.SetColorValue(SelectingUI.GetJSONColor().R); GreenSelection.SetColorValue(SelectingUI.GetJSONColor().G); BlueSelection.SetColorValue(SelectingUI.GetJSONColor().B); }
/// <summary> /// Sets the color of the UI that showed this display to the currently /// selected color. /// </summary> public void ConfirmColorChange() { TrialManager.JsonColor color = new TrialManager.JsonColor { R = RedSelection.GetColorValue(), G = GreenSelection.GetColorValue(), B = BlueSelection.GetColorValue() }; SelectingUI.SetJSONColor(color); }
/// <summary> /// Called when the color values are updated. Changes the displayed /// color in the ColorDisplay. /// </summary> public void ColorUpdated() { TrialManager.JsonColor color = new TrialManager.JsonColor { R = RedSelection.GetColorValue(), G = GreenSelection.GetColorValue(), B = BlueSelection.GetColorValue() }; ColorDisplay.color = color.GetColor(); }