Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
Empyrean.ColorPicker.SliderBackgroundController Class Reference
Inheritance diagram for Empyrean.ColorPicker.SliderBackgroundController:

Public Member Functions

void Init (LabeledColorSlider parent)
 
void ToggleSliderMode ()
 

Private Member Functions

void Awake ()
 
void UpdateBackround (Color color)
 
void GenerateSliderTexture ()
 
Color[] GenerateColorSpectrum ()
 
Color GetColorByTypeAndIndex (int index)
 
IEnumerator DelayedUpdateBg ()
 

Private Attributes

ColorPicker colorPicker
 
RawImage sliderBackground
 
LabeledColorSlider parent
 
Color[] colorArray
 

Detailed Description

Definition at line 8 of file SliderBackgroundController.cs.

Member Function Documentation

◆ Awake()

void Empyrean.ColorPicker.SliderBackgroundController.Awake ( )
inlineprivate

◆ DelayedUpdateBg()

◆ GenerateColorSpectrum()

Color[] Empyrean.ColorPicker.SliderBackgroundController.GenerateColorSpectrum ( )
inlineprivate

Definition at line 42 of file SliderBackgroundController.cs.

43 {
44 Color[] array = new Color[256];
45 for (int i = 0; i < 256; i++)
46 {
47 array[i] = GetColorByTypeAndIndex(i);
48 }
49 return array;
50 }

References Color, and Empyrean.ColorPicker.SliderBackgroundController.GetColorByTypeAndIndex().

Referenced by Empyrean.ColorPicker.SliderBackgroundController.GenerateSliderTexture().

◆ GenerateSliderTexture()

void Empyrean.ColorPicker.SliderBackgroundController.GenerateSliderTexture ( )
inlineprivate

Definition at line 30 of file SliderBackgroundController.cs.

31 {
32 Color[] array = ((parent.Type == SliderType.Hue) ? HueSlider.GenerateHsvSpectrum() : GenerateColorSpectrum());
33 Texture2D texture2D = new Texture2D(array.Length, 1);
34 for (int i = 0; i < texture2D.width; i++)
35 {
36 texture2D.SetPixel(i, 1, array[i]);
37 }
38 texture2D.Apply();
39 sliderBackground.texture = texture2D;
40 }

References Color, Empyrean.ColorPicker.SliderBackgroundController.GenerateColorSpectrum(), and Empyrean.ColorPicker.HueSlider.GenerateHsvSpectrum().

Referenced by Empyrean.ColorPicker.SliderBackgroundController.UpdateBackround().

◆ GetColorByTypeAndIndex()

Color Empyrean.ColorPicker.SliderBackgroundController.GetColorByTypeAndIndex ( int  index)
inlineprivate

Definition at line 52 of file SliderBackgroundController.cs.

53 {
54 Color selectedColor = colorPicker.SelectedColor;
55 switch (parent.Type)
56 {
57 case SliderType.Red:
58 return new Color((float)index / 255f, selectedColor.g, selectedColor.b, 1f);
59 case SliderType.Green:
60 return new Color(selectedColor.r, (float)index / 255f, selectedColor.b, 1f);
61 case SliderType.Blue:
62 return new Color(selectedColor.r, selectedColor.g, (float)index / 255f, 1f);
63 case SliderType.Sat:
64 {
65 float v = ((colorPicker.ValueHSV >= 0.3f) ? colorPicker.ValueHSV : 0.3f);
66 return new HSVColor(colorPicker.Hue, (float)index / 255f, v).ToRGB();
67 }
68 case SliderType.Val:
69 return new HSVColor(colorPicker.Hue, colorPicker.Saturation, (float)index / 255f).ToRGB();
70 case SliderType.Alpha:
71 return new Color(1f, 1f, 1f, (float)index / 255f);
72 default:
73 return Color.red;
74 }
75 }

References Color, Empyrean.ColorPicker.SliderBackgroundController.colorPicker, Empyrean.ColorPicker.ColorPicker.Hue, Empyrean.ColorPicker.SliderBackgroundController.parent, Empyrean.ColorPicker.ColorPicker.Saturation, Empyrean.ColorPicker.ColorPicker.SelectedColor, Empyrean.ColorPicker.LabeledColorSlider.Type, and Empyrean.ColorPicker.ColorPicker.ValueHSV.

Referenced by Empyrean.ColorPicker.SliderBackgroundController.GenerateColorSpectrum().

◆ Init()

void Empyrean.ColorPicker.SliderBackgroundController.Init ( LabeledColorSlider  parent)
inline

◆ ToggleSliderMode()

void Empyrean.ColorPicker.SliderBackgroundController.ToggleSliderMode ( )
inline

◆ UpdateBackround()

Member Data Documentation

◆ colorArray

Color [] Empyrean.ColorPicker.SliderBackgroundController.colorArray
private

Definition at line 18 of file SliderBackgroundController.cs.

◆ colorPicker

ColorPicker Empyrean.ColorPicker.SliderBackgroundController.colorPicker
private

◆ parent

LabeledColorSlider Empyrean.ColorPicker.SliderBackgroundController.parent
private

◆ sliderBackground

RawImage Empyrean.ColorPicker.SliderBackgroundController.sliderBackground
private

Definition at line 14 of file SliderBackgroundController.cs.


The documentation for this class was generated from the following file: