Color picker UI integration
parent
b1d6e43512
commit
d5702ee0e7
@ -0,0 +1,21 @@
|
||||
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;
|
||||
|
||||
[SerializeField] private BoxSlider _slider;
|
||||
[SerializeField] private Image _image;
|
||||
|
||||
public void OnSliderUpdate(Vector2 value) { }
|
||||
|
||||
public void OnColorUpdate(Color rgb, ColorHSL hsl) { }
|
||||
}
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
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 Selectable _textBox;
|
||||
[SerializeField] private Slider _slider;
|
||||
[SerializeField] private Image _image;
|
||||
|
||||
public void OnTextBoxUpdate(string text) { }
|
||||
|
||||
public void OnSliderUpdate(float value) { }
|
||||
|
||||
public void OnColorUpdate(Color rgb, ColorHSL hsl) { }
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
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;
|
||||
}
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using ConformalDecals.Util;
|
||||
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;
|
||||
|
||||
public void OnClose() { }
|
||||
|
||||
public void OnHexColorUpdate(string text) { }
|
||||
|
||||
public void OnChannelUpdate(float value, int channel, bool hsl) { }
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:29f1da73b9f5fbd996162fb61f99378b5f05fbc35d93d04907c6025963f8a4c4
|
||||
size 347881
|
||||
oid sha256:282c893d34ca9c703aee8c1af30efe3fcf9fb38d28cee5097a470ddcc2eaaf7a
|
||||
size 364831
|
||||
|
Binary file not shown.
Loading…
Reference in New Issue