mirror of
https://github.com/drewcassidy/KSP-Conformal-Decals.git
synced 2024-09-01 18:23:54 +00:00
Working color picker UI
This commit is contained in:
@ -1,21 +1,13 @@
|
||||
using ConformalDecals.Util;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace ConformalDecals.UI {
|
||||
public class ColorBoxSlider : MonoBehaviour {
|
||||
[SerializeField] private ColorPickerController.ChannelUpdateEvent _onXChannelChanged = new ColorPickerController.ChannelUpdateEvent();
|
||||
[SerializeField] private ColorPickerController.ChannelUpdateEvent _onYChannelChanged = new ColorPickerController.ChannelUpdateEvent();
|
||||
|
||||
[SerializeField] private Vector2 _value;
|
||||
[SerializeField] private Vector2Int _channel;
|
||||
[SerializeField] private bool _hsl;
|
||||
public class ColorBoxSlider : MonoBehaviour{
|
||||
[SerializeField] private Vector2 _value;
|
||||
|
||||
[SerializeField] private BoxSlider _slider;
|
||||
[SerializeField] private Image _image;
|
||||
|
||||
public void OnSliderUpdate(Vector2 value) { }
|
||||
|
||||
public void OnColorUpdate(Color rgb, ColorHSL hsl) { }
|
||||
}
|
||||
}
|
@ -1,14 +1,11 @@
|
||||
using ConformalDecals.Util;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace ConformalDecals.UI {
|
||||
public class ColorChannelSlider : MonoBehaviour {
|
||||
[SerializeField] private ColorPickerController.ChannelUpdateEvent _onChannelChanged = new ColorPickerController.ChannelUpdateEvent();
|
||||
|
||||
[SerializeField] private float _value;
|
||||
[SerializeField] private int _channel;
|
||||
[SerializeField] private bool _hsl;
|
||||
[SerializeField] private bool _hsv;
|
||||
|
||||
[SerializeField] private Selectable _textBox;
|
||||
[SerializeField] private Slider _slider;
|
||||
@ -17,7 +14,5 @@ namespace ConformalDecals.UI {
|
||||
public void OnTextBoxUpdate(string text) { }
|
||||
|
||||
public void OnSliderUpdate(float value) { }
|
||||
|
||||
public void OnColorUpdate(Color rgb, ColorHSL hsl) { }
|
||||
}
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using UnityEngine;
|
||||
|
||||
namespace ConformalDecals.Util {
|
||||
public struct ColorHSL {
|
||||
public float h;
|
||||
public float s;
|
||||
public float l;
|
||||
public float a;
|
||||
}
|
||||
}
|
@ -1,19 +1,11 @@
|
||||
using System;
|
||||
using ConformalDecals.Util;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Events;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace ConformalDecals.UI {
|
||||
public class ColorPickerController : MonoBehaviour {
|
||||
[Serializable]
|
||||
public class ColorUpdateEvent : UnityEvent<Color, ColorHSL> { }
|
||||
|
||||
[Serializable]
|
||||
public class ChannelUpdateEvent : UnityEvent<float, int, bool> { }
|
||||
|
||||
[SerializeField] private ColorUpdateEvent _onColorChanged = new ColorUpdateEvent();
|
||||
|
||||
[SerializeField] private Color _value;
|
||||
[SerializeField] private Image _previewImage;
|
||||
[SerializeField] private Selectable _hexTextBox;
|
||||
@ -21,7 +13,5 @@ namespace ConformalDecals.UI {
|
||||
public void OnClose() { }
|
||||
|
||||
public void OnHexColorUpdate(string text) { }
|
||||
|
||||
public void OnChannelUpdate(float value, int channel, bool hsl) { }
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user