using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using Cinnamon; using GameEvent; using HarmonyLib; using UnityEngine; using UnityEngine.Events; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AutoUpdate("Osqat/OssieCustomColors")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.2.0.0")] [module: UnverifiableCode] namespace OssieCustomColors; public class ColorPickerUI : MonoBehaviour, InputReceiver, IGameEventListener { private class CanvasSwatch { public RectTransform Root; public Image Fill; public Image Border; public RectTransform DeleteRoot; public Image DeleteBg; public Text DeleteText; } private int _maxColors; private bool _customMode; private List _savedColors; private int _selectedIdx = -1; private PickableCustomizationButton[] _allColorBtns; private PickableCustomizationButton[] _allBlockColorBtns; private SpriteRenderer[] _colorBtnRenderers; private int _rightmostBtnIdx; private float _btnW; private float _btnH; private bool _layoutReady; private bool _nativeButtonsHidden; private bool _nativeVisibilityDirty = true; private bool _open; private bool _bookOpen; private bool _deleteMode; private int _editingSavedColorIndex = -1; private InventoryBook _inventoryBookCache; private float _r; private float _g; private float _b; private float _h; private float _s; private float _v; private string _hexInput = "FFFFFF"; private bool _loggedColorSpace; private Texture2D _svTex; private Texture2D _hueTex; private Color[] _svPixels; private float _lastHueForSvTex = -1f; private bool _svDragging; private bool _hueDragging; private readonly Dictionary _calibratedBackendColors = new Dictionary(); private Color _lastDisplayColor = Color.white; private Color _lastBackendColor = Color.white; private string _lastDisplayHex = ""; private string _lastBackendHex = ""; private readonly Color[] _nearestBackendColors = (Color[])(object)new Color[8]; private readonly Color[] _nearestDisplayColors = (Color[])(object)new Color[8]; private readonly float[] _nearestDistances = new float[8]; private bool _eyedropperActive; private bool _pendingReopenPicker; private bool _reopenGotoRequested; private bool _eyedropperCancelQueued; private int _eyedropperPlayerNumber; private int _pendingColorPageNumber = -1; private Controller _eyedropperController; private bool _stylesReady; private Font _font; private GUIStyle _titleStyle; private GUIStyle _labelStyle; private GUIStyle _btnStyle; private GUIStyle _actionBtnStyle; private GUIStyle _fieldStyle; private GUIStyle _toggleStyle; private GUIStyle _plusStyle; private GUIStyle _xStyle; private Texture2D _texPanel; private Texture2D _texBtn; private Texture2D _texBtnHov; private Texture2D _texSwatch; private Texture2D _texWhite; private Texture2D _texDark; private Texture2D _texAccent; private Canvas _uiCanvas; private RectTransform _canvasRect; private RectTransform _uiRoot; private InventoryPage _uiPage; private bool _uiBuilt; private bool _ownsUiCanvas; private Sprite _uiSprite; private bool _uiUsesInventoryCamera; private bool _loggedCanvasConfig; private bool _syncingHexField; private RectTransform _toggleRt; private Image _toggleBg; private Text _toggleText; private Rect _toggleGuiRect; private Image _trashBg; private Image _trashCanBody; private Image _trashCanLid; private RectTransform _trashRt; private Rect _trashGuiRect; private Image _plusBg; private Text _plusText; private RectTransform _plusRt; private Rect _plusGuiRect; private readonly List _swatchViews = new List(); private readonly List _swatchGuiRects = new List(); private readonly List _editGuiRects = new List(); private readonly List _pickerGraphics = new List(); private readonly List _buttonBuildBuffer = new List(); private readonly List _blockColorBuildBuffer = new List(); private readonly List _cachedCursorRendererCursors = new List(); private readonly List _cachedCursorRenderers = new List(); private RectTransform _pickerRoot; private Image _pickerPanelBg; private Text _pickerTitle; private RawImage _svRaw; private RawImage _hueRaw; private Image _svCursorOuter; private Image _svCursorInner; private Image _hueMarkerOuter; private Image _hueMarkerInner; private Text _hexLabel; private InputField _hexField; private Image _hexBg; private Image _previewImage; private Image _useBg; private Image _saveBg; private Image _pickBg; private Image _pickIconHandle; private Image _pickIconTip; private Image _cancelBg; private Text _useText; private Text _saveText; private Text _cancelText; private RectTransform _useRt; private RectTransform _saveRt; private RectTransform _pickRt; private RectTransform _cancelRt; private Rect _panelGuiRect; private Rect _svGuiRect; private Rect _hueGuiRect; private Rect _hexGuiRect; private Rect _useGuiRect; private Rect _saveGuiRect; private Rect _pickGuiRect; private Rect _cancelGuiRect; private int _acceptPressedFrame = -999; private int _acceptConsumedFrame = -999; private int _acceptReleasedFrame = -999; private bool _acceptHeld; private Controller _acceptSender; private static readonly Color ColPanel = new Color(0.06f, 0.06f, 0.08f, 0.97f); private static readonly Color ColTitle = Color.white; private static readonly Color ColBody = new Color(0.78f, 0.8f, 0.84f, 1f); private static readonly Color ColBtn = new Color(1f, 0.82f, 0.3f, 1f); private static readonly Color ColBtnHov = new Color(1f, 0.9f, 0.5f, 1f); private static readonly Color ColBtnText = new Color(0.1f, 0.09f, 0.06f, 1f); private static readonly Color ColDark = new Color(0.1f, 0.1f, 0.12f, 0.95f); private static readonly Color ColAccent = new Color(0.3f, 0.65f, 1f, 0.95f); private static readonly Color ColDanger = new Color(1f, 0.18f, 0.14f, 0.95f); public static ColorPickerUI Instance { get; private set; } private void Awake() { Instance = this; Controller.AddGlobalReceiver((InputReceiver)(object)this); GameEventManager.ChangeListener((IGameEventListener)(object)this, true); GameEventManager.ChangeListener((IGameEventListener)(object)this, true); LoadColors(); } private void OnDestroy() { if ((Object)(object)Instance == (Object)(object)this) { Instance = null; } Controller.RemoveGlobalReceiver((InputReceiver)(object)this); GameEventManager.ChangeListener((IGameEventListener)(object)this, false); GameEventManager.ChangeListener((IGameEventListener)(object)this, false); DestroyCanvasUi(); if ((Object)(object)_uiSprite != (Object)null) { Object.Destroy((Object)(object)_uiSprite); } if ((Object)(object)_svTex != (Object)null) { Object.Destroy((Object)(object)_svTex); } if ((Object)(object)_hueTex != (Object)null) { Object.Destroy((Object)(object)_hueTex); } } private static bool IsFreeplay() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Invalid comparison between Unknown and I4 GameSettings instance = GameSettings.GetInstance(); if ((Object)(object)instance != (Object)null) { return (int)instance.GameMode == 0; } return false; } private void Update() { bool flag = IsFreeplay(); if ((Object)(object)_inventoryBookCache == (Object)null) { _inventoryBookCache = Object.FindObjectOfType(); } bool flag2 = (Object)(object)_inventoryBookCache != (Object)null && ((Component)_inventoryBookCache).gameObject.activeInHierarchy && _inventoryBookCache.Visible; if (flag2 && !_bookOpen) { _bookOpen = true; _open = false; InvalidateButtonCache(restoreNatives: true); } else if (!flag2 && _bookOpen) { _bookOpen = false; _open = false; InvalidateButtonCache(restoreNatives: true); } if (!flag || !_bookOpen) { _open = false; SetCanvasVisible(visible: false); SetPickerGraphicsVisible(visible: false); if (!flag && _customMode) { _customMode = false; _open = false; CancelEyedropperMode(reopenPicker: false); _nativeVisibilityDirty = true; SyncNativesToMode(); } return; } HandlePendingPickerReopen(); if (_open && Input.GetKeyDown((KeyCode)27)) { _open = false; } RefreshButtons(); bool flag3 = _layoutReady && IsColorPageActive(); if (!flag3) { _open = false; } else { HandlePendingPickerReopen(); } SyncNativesToMode(); UpdateCanvasUi(flag3); } public void OnBookShown() { _bookOpen = true; _open = false; _inventoryBookCache = null; InvalidateButtonCache(restoreNatives: true); } public void OnBookHidden() { _bookOpen = false; _open = false; InvalidateButtonCache(restoreNatives: true); SetCanvasVisible(visible: false); } public void Open(Color current) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) _r = current.r; _g = current.g; _b = current.b; Color.RGBToHSV(current, ref _h, ref _s, ref _v); _lastHueForSvTex = -1f; _hexInput = ToHex(_r, _g, _b); _open = true; } private void OnGUI() { if (_eyedropperActive) { DrawEyedropperOverlay(); } if (IsFreeplay()) { _ = _bookOpen; } } void IGameEventListener.handleEvent(GameEvent e) { if (!_eyedropperActive || e == null) { return; } PauseEvent val = (PauseEvent)(object)((e is PauseEvent) ? e : null); if (val != null && val.Paused) { ClearEyedropperStateOnly(); return; } SoftPauseEvent val2 = (SoftPauseEvent)(object)((e is SoftPauseEvent) ? e : null); if (val2 != null && val2.SoftPaused) { ClearEyedropperStateOnly(); } } private void DrawEyedropperOverlay() { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Expected O, but got Unknown //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) EnsureStyles(); if (_stylesReady) { Rect val = default(Rect); ((Rect)(ref val))..ctor(((float)Screen.width - 760f) * 0.5f, 20f, 760f, 250f); GUI.DrawTexture(val, (Texture)(object)(((Object)(object)_texPanel != (Object)null) ? _texPanel : Texture2D.whiteTexture)); GUIStyle val2 = new GUIStyle(_labelStyle) { fontSize = 16, wordWrap = true, alignment = (TextAnchor)0 }; GUI.Label(new Rect(((Rect)(ref val)).x + 20f, ((Rect)(ref val)).y + 14f, ((Rect)(ref val)).width - 40f, 34f), "OCC EYEDROPPER MODE", _titleStyle); GUI.Label(new Rect(((Rect)(ref val)).x + 30f, ((Rect)(ref val)).y + 62f, ((Rect)(ref val)).width - 60f, 44f), "Hover a placed colorable block and click / press Accept to copy its color.", val2); GUI.Label(new Rect(((Rect)(ref val)).x + 30f, ((Rect)(ref val)).y + 116f, ((Rect)(ref val)).width - 60f, 44f), "Click empty space to cancel and return to OCC without changing color.", val2); GUI.Label(new Rect(((Rect)(ref val)).x + 30f, ((Rect)(ref val)).y + 170f, ((Rect)(ref val)).width - 60f, 52f), "Back / B cancels and returns to the OCC color picker. Escape is disabled in this mode.", val2); } } private void InvalidateButtonCache(bool restoreNatives) { if (restoreNatives) { SetNativeButtonsVisible(visible: true); } _allColorBtns = null; _allBlockColorBtns = null; _colorBtnRenderers = null; _layoutReady = false; _btnW = (_btnH = 0f); _nativeVisibilityDirty = true; ClearCursorRendererCache(); } private void RefreshButtons() { //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) if (_layoutReady && _allColorBtns != null && _allColorBtns.Length != 0 && (Object)(object)_allColorBtns[0] != (Object)null && IsCurrentColorPageButton(_allColorBtns[0])) { return; } InvalidateButtonCache(restoreNatives: true); _buttonBuildBuffer.Clear(); _blockColorBuildBuffer.Clear(); PickableCustomizationButton[] array = Object.FindObjectsOfType(true); foreach (PickableCustomizationButton val in array) { if (!((Object)(object)val == (Object)null) && (int)val.customizationType == 0) { _blockColorBuildBuffer.Add(val); if (IsCurrentColorPageButton(val)) { _buttonBuildBuffer.Add(val); } } } if (_blockColorBuildBuffer.Count > 0) { _allBlockColorBtns = _blockColorBuildBuffer.ToArray(); } _buttonBuildBuffer.Sort(CompareColorButtonsForLayout); PickableCustomizationButton[] array2 = _buttonBuildBuffer.ToArray(); if (array2.Length == 0) { return; } Plugin.Log.LogInfo((object)$"[OssieCustomColors] RefreshButtons: {array2.Length} current-page BlockColors buttons found"); _allColorBtns = array2; _colorBtnRenderers = (SpriteRenderer[])(object)new SpriteRenderer[_allColorBtns.Length]; Camera val2 = InventoryLayoutCamera(); if ((Object)(object)val2 == (Object)null) { InvalidateButtonCache(restoreNatives: false); return; } if (!TryUpdateButtonSize(val2, keepLargest: false)) { InvalidateButtonCache(restoreNatives: false); _btnW = (_btnH = 0f); return; } _rightmostBtnIdx = 0; float num = float.MinValue; for (int j = 0; j < _allColorBtns.Length; j++) { float x = val2.WorldToScreenPoint(((Component)_allColorBtns[j]).transform.position).x; if (x > num) { num = x; _rightmostBtnIdx = j; } } _maxColors = Mathf.Max(1, _allColorBtns.Length - 1); _layoutReady = true; _nativeVisibilityDirty = true; Plugin.Log.LogInfo((object)$"[OssieCustomColors] Layout ready: {_allColorBtns.Length} buttons, max={_maxColors}, size={_btnW:F1}x{_btnH:F1}px, rightmost={_rightmostBtnIdx}"); } private static int CompareColorButtonsForLayout(PickableCustomizationButton a, PickableCustomizationButton b) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)a == (Object)(object)b) { return 0; } if ((Object)(object)a == (Object)null) { return 1; } if ((Object)(object)b == (Object)null) { return -1; } Vector3 position = ((Component)a).transform.position; Vector3 position2 = ((Component)b).transform.position; int num = position2.y.CompareTo(position.y); if (num == 0) { return position.x.CompareTo(position2.x); } return num; } private bool IsCurrentColorPageButton(PickableCustomizationButton button) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)button == (Object)null || (int)button.customizationType != 0) { return false; } InventoryBook val = ((PickableButton)button).InventoryBook ?? _inventoryBookCache; if ((Object)(object)val == (Object)null || !val.Visible || val.ScreenMode || !val.inInventory) { return false; } if ((Object)(object)_inventoryBookCache != (Object)null && (Object)(object)val != (Object)(object)_inventoryBookCache) { return false; } return val.currentPage == ((PickableButton)button).PageNumber; } private bool TryUpdateButtonSize(Camera cam, bool keepLargest) { //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)cam == (Object)null || _allColorBtns == null || _allColorBtns.Length == 0) { return false; } SpriteRenderer val = null; for (int i = 0; i < _allColorBtns.Length; i++) { SpriteRenderer colorButtonRenderer = GetColorButtonRenderer(i); if (!((Object)(object)colorButtonRenderer == (Object)null) && ((Renderer)colorButtonRenderer).enabled && ((Component)colorButtonRenderer).gameObject.activeInHierarchy) { Bounds bounds = ((Renderer)colorButtonRenderer).bounds; Vector3 size = ((Bounds)(ref bounds)).size; if (!(((Vector3)(ref size)).sqrMagnitude <= 0.0001f)) { val = colorButtonRenderer; break; } } } if ((Object)(object)val == (Object)null) { return false; } if (!TryGetProjectedBounds(cam, ((Renderer)val).bounds, out var w, out var h)) { return false; } if (w <= 5f || h <= 5f) { return false; } float num = Mathf.Max(w, h); if (keepLargest) { num = Mathf.Max(new float[3] { num, _btnW, _btnH }); } _btnW = (_btnH = num); return true; } private SpriteRenderer GetColorButtonRenderer(int index) { if (_allColorBtns == null || index < 0 || index >= _allColorBtns.Length) { return null; } if (_colorBtnRenderers == null || _colorBtnRenderers.Length != _allColorBtns.Length) { _colorBtnRenderers = (SpriteRenderer[])(object)new SpriteRenderer[_allColorBtns.Length]; } SpriteRenderer val = _colorBtnRenderers[index]; if ((Object)(object)val != (Object)null) { return val; } PickableCustomizationButton val2 = _allColorBtns[index]; val = (((Object)(object)val2 != (Object)null) ? ((Component)val2).GetComponentInChildren(true) : null); _colorBtnRenderers[index] = val; return val; } private bool TryGetProjectedBounds(Camera cam, Bounds bounds, out float w, out float h) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) w = (h = 0f); Vector3 min = ((Bounds)(ref bounds)).min; Vector3 max = ((Bounds)(ref bounds)).max; float num = float.PositiveInfinity; float num2 = float.NegativeInfinity; float num3 = float.PositiveInfinity; float num4 = float.NegativeInfinity; Vector3 val = default(Vector3); for (int i = 0; i < 2; i++) { for (int j = 0; j < 2; j++) { for (int k = 0; k < 2; k++) { ((Vector3)(ref val))..ctor((i == 0) ? min.x : max.x, (j == 0) ? min.y : max.y, (k == 0) ? min.z : max.z); Vector3 val2 = cam.WorldToScreenPoint(val); if (!(val2.z < 0f)) { num = Mathf.Min(num, val2.x); num2 = Mathf.Max(num2, val2.x); num3 = Mathf.Min(num3, val2.y); num4 = Mathf.Max(num4, val2.y); } } } } if (float.IsInfinity(num) || float.IsInfinity(num2) || float.IsInfinity(num3) || float.IsInfinity(num4) || float.IsNaN(num) || float.IsNaN(num2) || float.IsNaN(num3) || float.IsNaN(num4)) { return false; } w = num2 - num; h = num4 - num3; if (w > 0f) { return h > 0f; } return false; } private bool IsColorPageActive() { if (_allColorBtns == null || _allColorBtns.Length == 0) { return false; } PickableCustomizationButton val = _allColorBtns[0]; if ((Object)(object)val == (Object)null) { return false; } InventoryBook val2 = ((PickableButton)val).InventoryBook ?? _inventoryBookCache; if ((Object)(object)val2 == (Object)null || !val2.Visible || val2.ScreenMode) { return false; } if (!val2.inInventory) { return false; } return val2.currentPage == ((PickableButton)val).PageNumber; } private void SyncNativesToMode() { bool flag = _customMode && _layoutReady; if (_nativeVisibilityDirty || _nativeButtonsHidden != flag) { SetNativeButtonsVisible(!flag); _nativeButtonsHidden = flag; _nativeVisibilityDirty = false; } } private void ShowNativeButtons() { _nativeVisibilityDirty = true; SyncNativesToMode(); } private void HideNativeButtons() { _nativeVisibilityDirty = true; SyncNativesToMode(); } private void SetNativeButtonsVisible(bool visible) { PickableCustomizationButton[] array = _allBlockColorBtns ?? _allColorBtns; if (array == null) { return; } foreach (PickableCustomizationButton val in array) { if ((Object)(object)val != (Object)null && ((Component)val).gameObject.activeSelf != visible) { ((Component)val).gameObject.SetActive(visible); } } } private Rect ToggleRect(Camera cam) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) Vector3 val = cam.WorldToScreenPoint(((Component)_allColorBtns[_rightmostBtnIdx]).transform.position); float num = val.x + _btnW * 0.45f; float num2 = (float)Screen.height - val.y - _btnH; return new Rect(num - _btnW * 0.5f, num2 - _btnH * 0.5f, _btnW, _btnH); } private Rect TrashRect(Camera cam) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) Rect val = ToggleRect(cam); return new Rect(((Rect)(ref val)).x - ((Rect)(ref val)).width - _btnW * 0.15f, ((Rect)(ref val)).y, ((Rect)(ref val)).width, ((Rect)(ref val)).height); } private Rect PlusRect(Camera cam) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) Vector3 val = cam.WorldToScreenPoint(((Component)_allColorBtns[0]).transform.position); return new Rect(val.x - _btnW * 0.5f, (float)Screen.height - val.y - _btnH * 0.5f, _btnW, _btnH); } private Rect SwatchRect(Camera cam, int index) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) Vector3 val = cam.WorldToScreenPoint(((Component)_allColorBtns[index]).transform.position); return new Rect(val.x - _btnW * 0.5f, (float)Screen.height - val.y - _btnH * 0.5f, _btnW, _btnH); } private void DrawToggleButton() { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Invalid comparison between Unknown and I4 //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) if (_allColorBtns == null || _allColorBtns.Length == 0 || (Object)(object)_allColorBtns[_rightmostBtnIdx] == (Object)null) { return; } Camera main = Camera.main; if ((Object)(object)main == (Object)null) { return; } EnsureStyles(); if (!_stylesReady) { return; } Rect val = ToggleRect(main); Event current = Event.current; if ((int)current.type == 7) { GUI.DrawTexture(val, (Texture)(object)(_customMode ? _texAccent : _texDark)); GUI.Label(val, _customMode ? "S" : "C", _toggleStyle); } if (((int)current.type == 0 && PointerIn(val, current)) || ControllerClick(val)) { _customMode = !_customMode; if (_customMode) { HideNativeButtons(); } else { _open = false; HideCustomPaletteVisuals(); ShowNativeButtons(); } if (current.isMouse) { current.Use(); } } if (current.isMouse && PointerIn(val, current)) { current.Use(); } } private void DrawCustomPalette() { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Invalid comparison between Unknown and I4 //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Unknown result type (might be due to invalid IL or missing references) //IL_0234: Unknown result type (might be due to invalid IL or missing references) //IL_0236: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Invalid comparison between Unknown and I4 //IL_0263: Unknown result type (might be due to invalid IL or missing references) //IL_0269: Invalid comparison between Unknown and I4 //IL_0243: Unknown result type (might be due to invalid IL or missing references) //IL_0250: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_0270: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Invalid comparison between Unknown and I4 //IL_027e: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_029e: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) if (_savedColors == null || _allColorBtns == null || _allColorBtns.Length == 0) { return; } Camera main = Camera.main; if ((Object)(object)main == (Object)null) { return; } EnsureStyles(); if (!_stylesReady) { return; } Event current = Event.current; bool flag = (int)current.type == 7; Rect val2 = default(Rect); for (int num = 0; num < _savedColors.Count; num++) { Rect val = SwatchRect(main, num + 1); bool flag2 = PointerIn(val, current); ((Rect)(ref val2))..ctor(((Rect)(ref val)).xMax - 14f, ((Rect)(ref val)).yMin, 14f, 14f); bool flag3 = flag2 && PointerIn(val2, current); int num2; int num3; if (!((int)current.type == 0 && flag3)) { num2 = (ControllerClick(val2) ? 1 : 0); if (num2 == 0) { num3 = ((((int)current.type == 0 && flag2) || ControllerClick(val)) ? 1 : 0); goto IL_00d3; } } else { num2 = 1; } num3 = 0; goto IL_00d3; IL_00d3: bool flag4 = (byte)num3 != 0; if (num2 != 0) { _savedColors.RemoveAt(num); if (_selectedIdx == num) { _selectedIdx = -1; } else if (_selectedIdx > num) { _selectedIdx--; } SaveColors(); if (current.isMouse) { current.Use(); } return; } if (flag4) { SendColorChange(_savedColors[num]); _selectedIdx = num; if (current.isMouse) { current.Use(); } } if (flag) { if (num == _selectedIdx) { GUI.DrawTexture(new Rect(((Rect)(ref val)).x - 2f, ((Rect)(ref val)).y - 2f, ((Rect)(ref val)).width + 4f, ((Rect)(ref val)).height + 4f), (Texture)(object)_texWhite); } Color color = GUI.color; GUI.color = _savedColors[num]; GUI.DrawTexture(val, (Texture)(object)_texWhite); GUI.color = color; if (flag2) { GUI.DrawTexture(val2, (Texture)(object)_texDark); GUI.Label(val2, "x", _xStyle); } } if (current.isMouse && PointerIn(val, current)) { current.Use(); } } if (_savedColors.Count >= _maxColors) { return; } Rect val3 = PlusRect(main); bool flag5 = PointerIn(val3, current); if (flag) { GUI.DrawTexture(val3, (Texture)(object)_texDark); GUI.Label(val3, "+", _plusStyle); } if (((int)current.type == 0 && flag5) || ControllerClick(val3)) { Open(_lastDisplayColor); if (current.isMouse) { current.Use(); } } if (current.isMouse && PointerIn(val3, current)) { current.Use(); } } private void DrawPickerPanel() { //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Invalid comparison between Unknown and I4 //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Invalid comparison between Unknown and I4 //IL_025e: Unknown result type (might be due to invalid IL or missing references) //IL_026d: Unknown result type (might be due to invalid IL or missing references) //IL_0273: Invalid comparison between Unknown and I4 //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Invalid comparison between Unknown and I4 //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_028e: Unknown result type (might be due to invalid IL or missing references) //IL_0293: Unknown result type (might be due to invalid IL or missing references) //IL_0295: Unknown result type (might be due to invalid IL or missing references) //IL_02c5: Unknown result type (might be due to invalid IL or missing references) //IL_02d5: Unknown result type (might be due to invalid IL or missing references) //IL_0304: Unknown result type (might be due to invalid IL or missing references) //IL_0314: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_0205: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_032f: Unknown result type (might be due to invalid IL or missing references) //IL_0324: Unknown result type (might be due to invalid IL or missing references) //IL_0344: Unknown result type (might be due to invalid IL or missing references) //IL_034a: Invalid comparison between Unknown and I4 //IL_03d2: Unknown result type (might be due to invalid IL or missing references) //IL_03fd: Unknown result type (might be due to invalid IL or missing references) //IL_035d: Unknown result type (might be due to invalid IL or missing references) //IL_0363: Invalid comparison between Unknown and I4 //IL_04a7: Unknown result type (might be due to invalid IL or missing references) //IL_0522: Unknown result type (might be due to invalid IL or missing references) //IL_0370: Unknown result type (might be due to invalid IL or missing references) //IL_0375: Unknown result type (might be due to invalid IL or missing references) //IL_0378: Unknown result type (might be due to invalid IL or missing references) //IL_0367: Unknown result type (might be due to invalid IL or missing references) //IL_0536: Unknown result type (might be due to invalid IL or missing references) //IL_0443: Unknown result type (might be due to invalid IL or missing references) //IL_0450: Unknown result type (might be due to invalid IL or missing references) //IL_045d: Unknown result type (might be due to invalid IL or missing references) //IL_0469: Unknown result type (might be due to invalid IL or missing references) //IL_0542: Unknown result type (might be due to invalid IL or missing references) //IL_0556: Unknown result type (might be due to invalid IL or missing references) //IL_0562: Unknown result type (might be due to invalid IL or missing references) //IL_0576: Unknown result type (might be due to invalid IL or missing references) //IL_05a8: Unknown result type (might be due to invalid IL or missing references) //IL_05af: Invalid comparison between Unknown and I4 EnsureStyles(); if (!_stylesReady) { return; } float num = 324f; float num2 = (num - 260f) / 2f; float num3 = 490f; float num4 = ((float)Screen.width - 360f) * 0.5f; float num5 = ((float)Screen.height - num3) * 0.5f; float num6 = num4 + 18f; float num7 = num5 + 18f; GUI.DrawTexture(new Rect(num4, num5, 360f, num3), (Texture)(object)_texPanel); Event current = Event.current; GUI.Label(new Rect(num6, num7, num, 28f), "CUSTOM COLOR", _titleStyle); num7 += 40f; RebuildSvTexIfNeeded(); Rect val = default(Rect); ((Rect)(ref val))..ctor(num6 + num2, num7, 260f, 260f); GUI.DrawTexture(val, (Texture)(object)_svTex); if ((int)current.type == 7) { float num8 = ((Rect)(ref val)).x + _s * ((Rect)(ref val)).width; float num9 = ((Rect)(ref val)).y + (1f - _v) * ((Rect)(ref val)).height; Color color = GUI.color; GUI.color = Color.black; GUI.DrawTexture(new Rect(num8 - 6f, num9 - 6f, 12f, 12f), (Texture)(object)_texWhite); GUI.color = Color.white; GUI.DrawTexture(new Rect(num8 - 4f, num9 - 4f, 8f, 8f), (Texture)(object)_texWhite); GUI.color = color; } if (((int)current.type == 0 && PointerIn(val, current)) || ControllerClick(val)) { _svDragging = true; } if ((int)current.type == 1) { _svDragging = false; } if (_svDragging && ((int)current.type == 3 || (int)current.type == 0)) { Vector2 val2 = PointerPos(current); _s = Mathf.Clamp01((val2.x - ((Rect)(ref val)).x) / ((Rect)(ref val)).width); _v = Mathf.Clamp01(1f - (val2.y - ((Rect)(ref val)).y) / ((Rect)(ref val)).height); UpdateRgbFromHsv(); if (current.isMouse) { current.Use(); } } num7 += 268f; Rect val3 = default(Rect); ((Rect)(ref val3))..ctor(num6 + num2, num7, 260f, 18f); GUI.DrawTexture(val3, (Texture)(object)EnsureHueTex()); if ((int)current.type == 7) { float num10 = ((Rect)(ref val3)).x + _h * ((Rect)(ref val3)).width; Color color2 = GUI.color; GUI.color = Color.black; GUI.DrawTexture(new Rect(num10 - 2f, ((Rect)(ref val3)).y - 1f, 4f, ((Rect)(ref val3)).height + 2f), (Texture)(object)_texWhite); GUI.color = Color.white; GUI.DrawTexture(new Rect(num10 - 1f, ((Rect)(ref val3)).y - 1f, 2f, ((Rect)(ref val3)).height + 2f), (Texture)(object)_texWhite); GUI.color = color2; } if (((int)current.type == 0 && PointerIn(val3, current)) || ControllerClick(val3)) { _hueDragging = true; } if ((int)current.type == 1) { _hueDragging = false; } if (_hueDragging && ((int)current.type == 3 || (int)current.type == 0)) { Vector2 val4 = PointerPos(current); _h = Mathf.Clamp01((val4.x - ((Rect)(ref val3)).x) / ((Rect)(ref val3)).width); _lastHueForSvTex = -1f; UpdateRgbFromHsv(); if (current.isMouse) { current.Use(); } } num7 += 28f; GUI.Label(new Rect(num6, num7, 20f, 28f), "#", _labelStyle); string text = GUI.TextField(new Rect(num6 + 24f, num7, num - 24f, 28f), _hexInput, 6, _fieldStyle); if (text != _hexInput) { _hexInput = text; Color val5 = default(Color); if (ColorUtility.TryParseHtmlString("#" + text, ref val5)) { _r = val5.r; _g = val5.g; _b = val5.b; Color.RGBToHSV(val5, ref _h, ref _s, ref _v); _lastHueForSvTex = -1f; } } num7 += 36f; RefreshSwatch(); GUI.DrawTexture(new Rect(num6, num7, num, 28f), (Texture)(object)_texSwatch); num7 += 40f; float num11 = 292f; float num12 = num6 + (num - num11) / 2f; Rect val6 = default(Rect); ((Rect)(ref val6))..ctor(num12, num7, 100f, 42f); Rect val7 = default(Rect); ((Rect)(ref val7))..ctor(num12 + 106f, num7, 100f, 42f); Rect val8 = default(Rect); ((Rect)(ref val8))..ctor(num12 + 212f, num7, 80f, 42f); bool flag = GUI.Button(val6, "Use Color", _actionBtnStyle) || ControllerClick(val6); bool flag2 = GUI.Button(val7, "Save Color", _actionBtnStyle) || ControllerClick(val7); bool num13 = GUI.Button(val8, "Cancel", _actionBtnStyle) || ControllerClick(val8); if (flag) { UseColor(); } if (flag2) { SaveColor(); } if (num13) { _open = false; } if (current.isMouse && (int)current.type != 12) { current.Use(); } } private void UpdateCanvasUi(bool colorsTabActive) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Invalid comparison between Unknown and I4 if (!colorsTabActive) { _open = false; SetPickerGraphicsVisible(visible: false); SetCanvasVisible(visible: false); return; } EnsureCanvasUi(); if (_uiBuilt) { if ((Object)(object)_uiCanvas != (Object)null && (int)_uiCanvas.renderMode == 1) { ConfigureCanvasSortingBelowCursor(_uiCanvas); } SetCanvasVisible(visible: true); LayoutCanvasUi(); SyncCanvasUi(); HandleCanvasInput(); } } private void EnsureCanvasUi() { //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Expected O, but got Unknown //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) InventoryPage colorPage = GetColorPage(); Camera val = (((Object)(object)_inventoryBookCache != (Object)null) ? _inventoryBookCache.UiCamera : null); bool flag = (Object)(object)val != (Object)null; Canvas val2 = (_ownsUiCanvas ? _uiCanvas : null); if (_uiBuilt && (Object)(object)_uiCanvas != (Object)null && _ownsUiCanvas && (Object)(object)_uiPage == (Object)(object)colorPage && _uiUsesInventoryCamera == flag && (!flag || (Object)(object)_uiCanvas.worldCamera == (Object)(object)val)) { return; } if (_uiBuilt || (Object)(object)_uiRoot != (Object)null) { DestroyCanvasUi(); } if ((Object)(object)val2 == (Object)null) { GameObject val3 = new GameObject("OssieCustomColors.Canvas"); val3.transform.SetParent(((Component)this).transform, false); val3.layer = (flag ? 5 : 0); val2 = val3.AddComponent(); _ownsUiCanvas = true; } _uiCanvas = val2; _uiPage = colorPage; _uiUsesInventoryCamera = flag; ConfigureCanvas(val2, val); _canvasRect = ((Component)val2).GetComponent(); if (!((Object)(object)_canvasRect == (Object)null)) { if ((Object)(object)((Component)val2).GetComponent() == (Object)null) { ((Component)val2).gameObject.AddComponent(); } GameObject val4 = new GameObject("OssieCustomColors.CustomColorsCanvas"); val4.transform.SetParent(((Component)val2).transform, false); _uiRoot = val4.AddComponent(); _uiRoot.anchorMin = Vector2.zero; _uiRoot.anchorMax = Vector2.one; _uiRoot.offsetMin = Vector2.zero; _uiRoot.offsetMax = Vector2.zero; _uiRoot.pivot = new Vector2(0.5f, 0.5f); ((Transform)_uiRoot).SetAsLastSibling(); BuildCanvasUi(); if (flag) { SetLayerRecursive(((Component)_uiRoot).gameObject, 5); } _uiBuilt = true; } } private void ConfigureCanvas(Canvas canvas, Camera inventoryCamera) { //IL_00c0: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)inventoryCamera != (Object)null) { canvas.renderMode = (RenderMode)1; canvas.worldCamera = inventoryCamera; canvas.planeDistance = Mathf.Clamp(250f, inventoryCamera.nearClipPlane + 0.01f, inventoryCamera.farClipPlane - 0.01f); canvas.overrideSorting = true; ((Component)canvas).gameObject.layer = 5; ConfigureCanvasSortingBelowCursor(canvas); } else { canvas.renderMode = (RenderMode)0; canvas.worldCamera = null; canvas.overrideSorting = true; ((Component)canvas).gameObject.layer = 0; canvas.sortingOrder = 32760; } if (!_loggedCanvasConfig) { _loggedCanvasConfig = true; string text = (((Object)(object)inventoryCamera != (Object)null) ? ((Object)inventoryCamera).name : ""); Plugin.Log.LogInfo((object)$"[OssieCustomColors] Canvas config: mode={canvas.renderMode}, camera={text}, plane={canvas.planeDistance:F2}, layer={canvas.sortingLayerName}, order={canvas.sortingOrder}"); } } private void ConfigureCanvasSortingBelowCursor(Canvas canvas) { if (TryGetInventoryCursorRenderer(out var cursorRenderer)) { int num = Mathf.Max(-32768, ((Renderer)cursorRenderer).sortingOrder - 100); if (canvas.sortingLayerID != ((Renderer)cursorRenderer).sortingLayerID) { canvas.sortingLayerID = ((Renderer)cursorRenderer).sortingLayerID; } if (canvas.sortingOrder != num) { canvas.sortingOrder = num; } } else if ((Object)(object)_uiPage != (Object)null && (Object)(object)_uiPage.textCanvas != (Object)null) { int num2 = _uiPage.textCanvas.sortingOrder + 1000; if (canvas.sortingLayerID != _uiPage.textCanvas.sortingLayerID) { canvas.sortingLayerID = _uiPage.textCanvas.sortingLayerID; } if (canvas.sortingOrder != num2) { canvas.sortingOrder = num2; } } else { canvas.sortingLayerName = "UI 1"; canvas.sortingOrder = 29000; } } private void SetLayerRecursive(GameObject go, int layer) { if (!((Object)(object)go == (Object)null)) { Transform[] componentsInChildren = go.GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren.Length; i++) { ((Component)componentsInChildren[i]).gameObject.layer = layer; } } } private bool TryGetInventoryCursorRenderer(out SpriteRenderer cursorRenderer) { cursorRenderer = null; if ((Object)(object)_inventoryBookCache == (Object)null || _inventoryBookCache.cursors == null) { return false; } if (!CursorRendererCacheMatches()) { RebuildCursorRendererCache(); } for (int i = 0; i < _inventoryBookCache.cursors.Count; i++) { PickCursor val = _inventoryBookCache.cursors[i]; if ((Object)(object)val == (Object)null) { continue; } SpriteRenderer val2 = ((i < _cachedCursorRenderers.Count) ? _cachedCursorRenderers[i] : null); if ((Object)(object)val2 == (Object)null) { val2 = ((Component)val).GetComponentInChildren(true); while (_cachedCursorRenderers.Count <= i) { _cachedCursorRenderers.Add(null); } _cachedCursorRenderers[i] = val2; } if (!((Object)(object)val2 == (Object)null)) { cursorRenderer = val2; return true; } } return false; } private void RebuildCursorRendererCache() { ClearCursorRendererCache(); if (!((Object)(object)_inventoryBookCache == (Object)null) && _inventoryBookCache.cursors != null) { for (int i = 0; i < _inventoryBookCache.cursors.Count; i++) { PickCursor val = _inventoryBookCache.cursors[i]; _cachedCursorRendererCursors.Add(val); _cachedCursorRenderers.Add(((Object)(object)val != (Object)null) ? ((Component)val).GetComponentInChildren(true) : null); } } } private bool CursorRendererCacheMatches() { if ((Object)(object)_inventoryBookCache == (Object)null || _inventoryBookCache.cursors == null) { return _cachedCursorRendererCursors.Count == 0; } if (_cachedCursorRendererCursors.Count != _inventoryBookCache.cursors.Count) { return false; } for (int i = 0; i < _cachedCursorRendererCursors.Count; i++) { if ((Object)(object)_cachedCursorRendererCursors[i] != (Object)(object)_inventoryBookCache.cursors[i]) { return false; } } return true; } private void ClearCursorRendererCache() { _cachedCursorRendererCursors.Clear(); _cachedCursorRenderers.Clear(); } private InventoryPage GetColorPage() { if (_allColorBtns == null || _allColorBtns.Length == 0 || (Object)(object)_allColorBtns[0] == (Object)null) { return null; } InventoryBook val = ((PickableButton)_allColorBtns[0]).InventoryBook ?? _inventoryBookCache; if ((Object)(object)val == (Object)null || val.InventoryPages == null) { return null; } int pageNumber = ((PickableButton)_allColorBtns[0]).PageNumber; if (pageNumber < 0 || pageNumber >= val.InventoryPages.Length) { return null; } return val.InventoryPages[pageNumber]; } private void BuildCanvasUi() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Expected O, but got Unknown //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_022c: Unknown result type (might be due to invalid IL or missing references) //IL_0281: Unknown result type (might be due to invalid IL or missing references) //IL_02ae: Unknown result type (might be due to invalid IL or missing references) //IL_02e3: Unknown result type (might be due to invalid IL or missing references) //IL_0310: Unknown result type (might be due to invalid IL or missing references) //IL_039b: Unknown result type (might be due to invalid IL or missing references) //IL_03b7: Unknown result type (might be due to invalid IL or missing references) //IL_03c7: Unknown result type (might be due to invalid IL or missing references) //IL_03e1: Unknown result type (might be due to invalid IL or missing references) //IL_03fb: Unknown result type (might be due to invalid IL or missing references) //IL_0429: Unknown result type (might be due to invalid IL or missing references) //IL_0456: Unknown result type (might be due to invalid IL or missing references) //IL_049c: Unknown result type (might be due to invalid IL or missing references) //IL_04c9: Unknown result type (might be due to invalid IL or missing references) //IL_050f: Unknown result type (might be due to invalid IL or missing references) //IL_053c: Unknown result type (might be due to invalid IL or missing references) //IL_057a: Unknown result type (might be due to invalid IL or missing references) //IL_05a9: Unknown result type (might be due to invalid IL or missing references) //IL_05cb: Unknown result type (might be due to invalid IL or missing references) //IL_05fa: Unknown result type (might be due to invalid IL or missing references) //IL_061c: Unknown result type (might be due to invalid IL or missing references) //IL_0662: Unknown result type (might be due to invalid IL or missing references) EnsureCanvasResources(); _toggleBg = NewImage("ToggleBackground", ColDark); _toggleRt = ((Graphic)_toggleBg).rectTransform; _toggleText = NewText("ToggleText", "C", 16, (TextAnchor)4, Color.white, (Transform)(object)_toggleRt); _trashBg = NewImage("TrashBackground", ColDark); _trashRt = ((Graphic)_trashBg).rectTransform; _trashCanBody = NewImage("TrashCanBody", ColBody); _trashCanLid = NewImage("TrashCanLid", ColBody); _plusBg = NewImage("PlusBackground", ColDark); _plusRt = ((Graphic)_plusBg).rectTransform; _plusText = NewText("PlusText", "+", 24, (TextAnchor)4, Color.white, (Transform)(object)_plusRt); GameObject val = new GameObject("PickerRoot"); val.transform.SetParent((Transform)(object)_uiRoot, false); _pickerRoot = val.AddComponent(); _pickerRoot.anchorMin = Vector2.zero; _pickerRoot.anchorMax = Vector2.one; _pickerRoot.offsetMin = Vector2.zero; _pickerRoot.offsetMax = Vector2.zero; ((Component)_pickerRoot).gameObject.SetActive(false); _pickerPanelBg = NewImage("PickerPanel", ColPanel, (Transform)(object)_pickerRoot); _pickerGraphics.Add((Graphic)(object)_pickerPanelBg); _pickerTitle = NewText("PickerTitle", "CUSTOM COLOR", 20, (TextAnchor)4, ColTitle, (Transform)(object)_pickerRoot); _pickerGraphics.Add((Graphic)(object)_pickerTitle); _svRaw = NewRawImage("SvTexture", (Transform)(object)_pickerRoot); _pickerGraphics.Add((Graphic)(object)_svRaw); _svCursorOuter = NewImage("SvCursorOuter", Color.black, (Transform)(object)_pickerRoot); _pickerGraphics.Add((Graphic)(object)_svCursorOuter); _svCursorInner = NewImage("SvCursorInner", Color.white, (Transform)(object)_pickerRoot); _pickerGraphics.Add((Graphic)(object)_svCursorInner); _hueRaw = NewRawImage("HueTexture", (Transform)(object)_pickerRoot); _pickerGraphics.Add((Graphic)(object)_hueRaw); _hueMarkerOuter = NewImage("HueMarkerOuter", Color.black, (Transform)(object)_pickerRoot); _pickerGraphics.Add((Graphic)(object)_hueMarkerOuter); _hueMarkerInner = NewImage("HueMarkerInner", Color.white, (Transform)(object)_pickerRoot); _pickerGraphics.Add((Graphic)(object)_hueMarkerInner); _hexLabel = NewText("HexLabel", "#", 18, (TextAnchor)3, ColBody, (Transform)(object)_pickerRoot); _pickerGraphics.Add((Graphic)(object)_hexLabel); _hexBg = NewImage("HexBackground", ColDark, (Transform)(object)_pickerRoot); ((Graphic)_hexBg).raycastTarget = true; _pickerGraphics.Add((Graphic)(object)_hexBg); _hexField = ((Component)_hexBg).gameObject.AddComponent(); _hexField.characterLimit = 6; _hexField.lineType = (LineType)0; ((UnityEvent)(object)_hexField.onValueChanged).AddListener((UnityAction)OnHexFieldChanged); Text val2 = NewText("HexInputText", _hexInput, 18, (TextAnchor)3, ColBody, (Transform)(object)((Graphic)_hexBg).rectTransform); ((Graphic)val2).rectTransform.anchorMin = Vector2.zero; ((Graphic)val2).rectTransform.anchorMax = Vector2.one; ((Graphic)val2).rectTransform.offsetMin = new Vector2(8f, 2f); ((Graphic)val2).rectTransform.offsetMax = new Vector2(-8f, -2f); _hexField.textComponent = val2; _hexField.text = _hexInput; _previewImage = NewImage("PreviewSwatch", Color.white, (Transform)(object)_pickerRoot); _pickerGraphics.Add((Graphic)(object)_previewImage); _useBg = NewImage("UseButton", ColBtn, (Transform)(object)_pickerRoot); _useRt = ((Graphic)_useBg).rectTransform; _pickerGraphics.Add((Graphic)(object)_useBg); _useText = NewText("UseText", "Use Color", 14, (TextAnchor)4, ColBtnText, (Transform)(object)_useRt); _pickerGraphics.Add((Graphic)(object)_useText); _saveBg = NewImage("SaveButton", ColBtn, (Transform)(object)_pickerRoot); _saveRt = ((Graphic)_saveBg).rectTransform; _pickerGraphics.Add((Graphic)(object)_saveBg); _saveText = NewText("SaveText", "Save Color", 14, (TextAnchor)4, ColBtnText, (Transform)(object)_saveRt); _pickerGraphics.Add((Graphic)(object)_saveText); _pickBg = NewImage("EyedropperButton", ColDark, (Transform)(object)_pickerRoot); _pickRt = ((Graphic)_pickBg).rectTransform; _pickerGraphics.Add((Graphic)(object)_pickBg); _pickIconHandle = NewImage("EyedropperHandle", Color.white, (Transform)(object)_pickerRoot); ((Transform)((Graphic)_pickIconHandle).rectTransform).localRotation = Quaternion.Euler(0f, 0f, -45f); _pickerGraphics.Add((Graphic)(object)_pickIconHandle); _pickIconTip = NewImage("EyedropperTip", Color.white, (Transform)(object)_pickerRoot); ((Transform)((Graphic)_pickIconTip).rectTransform).localRotation = Quaternion.Euler(0f, 0f, -45f); _pickerGraphics.Add((Graphic)(object)_pickIconTip); _cancelBg = NewImage("CancelButton", ColBtn, (Transform)(object)_pickerRoot); _cancelRt = ((Graphic)_cancelBg).rectTransform; _pickerGraphics.Add((Graphic)(object)_cancelBg); _cancelText = NewText("CancelText", "Cancel", 14, (TextAnchor)4, ColBtnText, (Transform)(object)_cancelRt); _pickerGraphics.Add((Graphic)(object)_cancelText); SetPickerGraphicsVisible(visible: false); Plugin.Log.LogInfo((object)"[OssieCustomColors] Canvas UI built."); } private void SetPickerGraphicsVisible(bool visible) { if ((Object)(object)_pickerRoot != (Object)null && ((Component)_pickerRoot).gameObject.activeSelf != visible) { ((Component)_pickerRoot).gameObject.SetActive(visible); } for (int i = 0; i < _pickerGraphics.Count; i++) { if ((Object)(object)_pickerGraphics[i] != (Object)null) { ((Component)_pickerGraphics[i]).gameObject.SetActive(visible); } } } private void EnsureCanvasResources() { if ((Object)(object)_font == (Object)null) { _font = ResolveFont(); } EnsureUiSprite(); } private Image NewImage(string name, Color color, Transform parent = null) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject(name); val.transform.SetParent((Transform)(((Object)(object)parent != (Object)null) ? ((object)parent) : ((object)_uiRoot)), false); Image val2 = val.AddComponent(); val2.sprite = EnsureUiSprite(); val2.type = (Type)0; val2.preserveAspect = false; ((Graphic)val2).color = color; ((Graphic)val2).raycastTarget = false; RectTransform rectTransform = ((Graphic)val2).rectTransform; RectTransform rectTransform2 = ((Graphic)val2).rectTransform; Vector2 val3 = default(Vector2); ((Vector2)(ref val3))..ctor(0.5f, 0.5f); rectTransform2.anchorMax = val3; rectTransform.anchorMin = val3; ((Graphic)val2).rectTransform.pivot = new Vector2(0.5f, 0.5f); return val2; } private Sprite EnsureUiSprite() { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_uiSprite != (Object)null) { return _uiSprite; } _uiSprite = Sprite.Create(Texture2D.whiteTexture, new Rect(0f, 0f, 1f, 1f), new Vector2(0.5f, 0.5f), 100f); ((Object)_uiSprite).hideFlags = (HideFlags)61; return _uiSprite; } private RawImage NewRawImage(string name, Transform parent = null) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject(name); val.transform.SetParent((Transform)(((Object)(object)parent != (Object)null) ? ((object)parent) : ((object)_uiRoot)), false); RawImage val2 = val.AddComponent(); ((Graphic)val2).color = Color.white; ((Graphic)val2).raycastTarget = false; val2.texture = null; RectTransform rectTransform = ((Graphic)val2).rectTransform; RectTransform rectTransform2 = ((Graphic)val2).rectTransform; Vector2 val3 = default(Vector2); ((Vector2)(ref val3))..ctor(0.5f, 0.5f); rectTransform2.anchorMax = val3; rectTransform.anchorMin = val3; ((Graphic)val2).rectTransform.pivot = new Vector2(0.5f, 0.5f); return val2; } private Text NewText(string name, string text, int fontSize, TextAnchor alignment, Color color, Transform parent = null) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject(name); val.transform.SetParent((Transform)(((Object)(object)parent != (Object)null) ? ((object)parent) : ((object)_uiRoot)), false); Text val2 = val.AddComponent(); val2.font = (((Object)(object)_font != (Object)null) ? _font : ResolveFont()); val2.text = text; val2.fontSize = fontSize; val2.alignment = alignment; ((Graphic)val2).color = color; ((Graphic)val2).raycastTarget = false; val2.horizontalOverflow = (HorizontalWrapMode)1; val2.verticalOverflow = (VerticalWrapMode)1; if ((Object)(object)parent != (Object)null) { ((Graphic)val2).rectTransform.anchorMin = Vector2.zero; ((Graphic)val2).rectTransform.anchorMax = Vector2.one; ((Graphic)val2).rectTransform.offsetMin = Vector2.zero; ((Graphic)val2).rectTransform.offsetMax = Vector2.zero; } else { RectTransform rectTransform = ((Graphic)val2).rectTransform; RectTransform rectTransform2 = ((Graphic)val2).rectTransform; Vector2 val3 = default(Vector2); ((Vector2)(ref val3))..ctor(0.5f, 0.5f); rectTransform2.anchorMax = val3; rectTransform.anchorMin = val3; ((Graphic)val2).rectTransform.pivot = new Vector2(0.5f, 0.5f); } return val2; } private void DestroyCanvasUi() { _pickerGraphics.Clear(); _swatchViews.Clear(); _swatchGuiRects.Clear(); _editGuiRects.Clear(); if ((Object)(object)_uiRoot != (Object)null) { Object.Destroy((Object)(object)((Component)_uiRoot).gameObject); } if (_ownsUiCanvas && (Object)(object)_uiCanvas != (Object)null) { Object.Destroy((Object)(object)((Component)_uiCanvas).gameObject); } _uiCanvas = null; _canvasRect = null; _uiRoot = null; _uiPage = null; _pickerRoot = null; _uiBuilt = false; _ownsUiCanvas = false; _uiUsesInventoryCamera = false; _loggedCanvasConfig = false; } private void SetCanvasVisible(bool visible) { if ((Object)(object)_uiRoot != (Object)null && ((Component)_uiRoot).gameObject.activeSelf != visible) { ((Component)_uiRoot).gameObject.SetActive(visible); } } private void SetTrashVisible(bool visible) { if ((Object)(object)_trashRt != (Object)null && ((Component)_trashRt).gameObject.activeSelf != visible) { ((Component)_trashRt).gameObject.SetActive(visible); } if ((Object)(object)_trashCanBody != (Object)null && ((Component)_trashCanBody).gameObject.activeSelf != visible) { ((Component)_trashCanBody).gameObject.SetActive(visible); } if ((Object)(object)_trashCanLid != (Object)null && ((Component)_trashCanLid).gameObject.activeSelf != visible) { ((Component)_trashCanLid).gameObject.SetActive(visible); } } private void HideCustomPaletteVisuals() { if ((Object)(object)_plusRt != (Object)null) { ((Component)_plusRt).gameObject.SetActive(false); } SetTrashVisible(visible: false); for (int i = 0; i < _swatchViews.Count; i++) { ((Component)_swatchViews[i].Root).gameObject.SetActive(false); ((Component)_swatchViews[i].Border).gameObject.SetActive(false); ((Component)_swatchViews[i].DeleteRoot).gameObject.SetActive(false); } } private void LayoutCanvasUi() { //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_0249: Unknown result type (might be due to invalid IL or missing references) //IL_0311: Unknown result type (might be due to invalid IL or missing references) //IL_0316: Unknown result type (might be due to invalid IL or missing references) //IL_0343: Unknown result type (might be due to invalid IL or missing references) //IL_0350: Unknown result type (might be due to invalid IL or missing references) //IL_036a: Unknown result type (might be due to invalid IL or missing references) //IL_03bd: Unknown result type (might be due to invalid IL or missing references) //IL_03da: Unknown result type (might be due to invalid IL or missing references) //IL_0437: Unknown result type (might be due to invalid IL or missing references) //IL_043c: Unknown result type (might be due to invalid IL or missing references) //IL_0449: Unknown result type (might be due to invalid IL or missing references) Camera val = InventoryLayoutCamera(); if (_allColorBtns == null || _allColorBtns.Length == 0 || (Object)(object)val == (Object)null) { ((Component)_toggleRt).gameObject.SetActive(false); SetTrashVisible(visible: false); ((Component)_plusRt).gameObject.SetActive(false); for (int i = 0; i < _swatchViews.Count; i++) { ((Component)_swatchViews[i].Root).gameObject.SetActive(false); ((Component)_swatchViews[i].Border).gameObject.SetActive(false); ((Component)_swatchViews[i].DeleteRoot).gameObject.SetActive(false); } _swatchGuiRects.Clear(); _editGuiRects.Clear(); SetPickerGraphicsVisible(visible: false); return; } TryUpdateButtonSize(val, keepLargest: true); ((Component)_toggleRt).gameObject.SetActive(true); _toggleGuiRect = ToggleRect(val); if (!_loggedCanvasConfig) { Plugin.Log.LogInfo((object)$"[OssieCustomColors] Toggle rect: {_toggleGuiRect}"); } SetRectFromGui(_toggleRt, _toggleGuiRect); bool customMode = _customMode; SetTrashVisible(customMode); if (customMode) { _trashGuiRect = TrashRect(val); SetRectFromGui(_trashRt, _trashGuiRect); SetRectFromGui(((Graphic)_trashCanBody).rectTransform, new Rect(((Rect)(ref _trashGuiRect)).x + ((Rect)(ref _trashGuiRect)).width * 0.32f, ((Rect)(ref _trashGuiRect)).y + ((Rect)(ref _trashGuiRect)).height * 0.4f, ((Rect)(ref _trashGuiRect)).width * 0.36f, ((Rect)(ref _trashGuiRect)).height * 0.34f)); SetRectFromGui(((Graphic)_trashCanLid).rectTransform, new Rect(((Rect)(ref _trashGuiRect)).x + ((Rect)(ref _trashGuiRect)).width * 0.27f, ((Rect)(ref _trashGuiRect)).y + ((Rect)(ref _trashGuiRect)).height * 0.28f, ((Rect)(ref _trashGuiRect)).width * 0.46f, ((Rect)(ref _trashGuiRect)).height * 0.08f)); } EnsureSwatchViews(); _swatchGuiRects.Clear(); _editGuiRects.Clear(); int num = Mathf.Min((_savedColors != null) ? _savedColors.Count : 0, _maxColors); Rect val3 = default(Rect); for (int j = 0; j < _swatchViews.Count; j++) { bool flag = _customMode && j < num; ((Component)_swatchViews[j].Root).gameObject.SetActive(flag); ((Component)_swatchViews[j].Border).gameObject.SetActive(false); ((Component)_swatchViews[j].DeleteRoot).gameObject.SetActive(flag); if (flag) { Rect val2 = SwatchRect(val, j + 1); ((Rect)(ref val3))..ctor(((Rect)(ref val2)).xMax - 16f, ((Rect)(ref val2)).yMin, 16f, 16f); _swatchGuiRects.Add(val2); _editGuiRects.Add(val3); SetRectFromGui(_swatchViews[j].Root, val2); SetRectFromGui(((Graphic)_swatchViews[j].Border).rectTransform, new Rect(((Rect)(ref val2)).x - 2f, ((Rect)(ref val2)).y - 2f, ((Rect)(ref val2)).width + 4f, ((Rect)(ref val2)).height + 4f)); SetRectFromGui(_swatchViews[j].DeleteRoot, val3); } } bool flag2 = _customMode && _savedColors != null && _savedColors.Count < _maxColors; ((Component)_plusRt).gameObject.SetActive(flag2); if (flag2) { _plusGuiRect = PlusRect(val); SetRectFromGui(_plusRt, _plusGuiRect); } if (_open) { LayoutPickerCanvas(); } } private void LayoutPickerCanvas() { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_023c: Unknown result type (might be due to invalid IL or missing references) //IL_026a: Unknown result type (might be due to invalid IL or missing references) //IL_028b: Unknown result type (might be due to invalid IL or missing references) //IL_0290: Unknown result type (might be due to invalid IL or missing references) //IL_02a2: Unknown result type (might be due to invalid IL or missing references) //IL_02e0: Unknown result type (might be due to invalid IL or missing references) //IL_02f8: Unknown result type (might be due to invalid IL or missing references) //IL_02fd: Unknown result type (might be due to invalid IL or missing references) //IL_030a: Unknown result type (might be due to invalid IL or missing references) //IL_034c: Unknown result type (might be due to invalid IL or missing references) //IL_038e: Unknown result type (might be due to invalid IL or missing references) //IL_03c7: Unknown result type (might be due to invalid IL or missing references) //IL_03cc: Unknown result type (might be due to invalid IL or missing references) //IL_03e6: Unknown result type (might be due to invalid IL or missing references) //IL_03eb: Unknown result type (might be due to invalid IL or missing references) //IL_0405: Unknown result type (might be due to invalid IL or missing references) //IL_040a: Unknown result type (might be due to invalid IL or missing references) //IL_0417: Unknown result type (might be due to invalid IL or missing references) //IL_0429: Unknown result type (might be due to invalid IL or missing references) //IL_043b: Unknown result type (might be due to invalid IL or missing references) float num = 394f; float num2 = 492f; float num3 = ((float)Screen.width - 430f) * 0.5f; float num4 = ((float)Screen.height - num2) * 0.5f; float num5 = num3 + 18f; float num6 = num4 + 18f; _panelGuiRect = new Rect(num3, num4, 430f, num2); SetRectFromGui(((Graphic)_pickerPanelBg).rectTransform, _panelGuiRect); SetRectFromGui(((Graphic)_pickerTitle).rectTransform, new Rect(num5, num6, num, 28f)); num6 += 40f; _svGuiRect = new Rect(num5, num6, num, 260f); SetRectFromGui(((Graphic)_svRaw).rectTransform, _svGuiRect); float num7 = ((Rect)(ref _svGuiRect)).x + _s * ((Rect)(ref _svGuiRect)).width; float num8 = ((Rect)(ref _svGuiRect)).y + (1f - _v) * ((Rect)(ref _svGuiRect)).height; SetRectFromGui(((Graphic)_svCursorOuter).rectTransform, new Rect(num7 - 6f, num8 - 6f, 12f, 12f)); SetRectFromGui(((Graphic)_svCursorInner).rectTransform, new Rect(num7 - 4f, num8 - 4f, 8f, 8f)); num6 += 268f; _hueGuiRect = new Rect(num5, num6, num, 18f); SetRectFromGui(((Graphic)_hueRaw).rectTransform, _hueGuiRect); float num9 = ((Rect)(ref _hueGuiRect)).x + _h * ((Rect)(ref _hueGuiRect)).width; SetRectFromGui(((Graphic)_hueMarkerOuter).rectTransform, new Rect(num9 - 2f, ((Rect)(ref _hueGuiRect)).y - 1f, 4f, ((Rect)(ref _hueGuiRect)).height + 2f)); SetRectFromGui(((Graphic)_hueMarkerInner).rectTransform, new Rect(num9 - 1f, ((Rect)(ref _hueGuiRect)).y - 1f, 2f, ((Rect)(ref _hueGuiRect)).height + 2f)); num6 += 28f; SetRectFromGui(((Graphic)_hexLabel).rectTransform, new Rect(num5, num6, 20f, 28f)); _hexGuiRect = new Rect(num5 + 24f, num6, num - 24f, 28f); SetRectFromGui(((Graphic)_hexBg).rectTransform, _hexGuiRect); num6 += 36f; float num10 = 28f; float num11 = 8f; SetRectFromGui(((Graphic)_previewImage).rectTransform, new Rect(num5, num6, num - num10 - num11, 28f)); _pickGuiRect = new Rect(num5 + num - num10, num6, num10, num10); SetRectFromGui(_pickRt, _pickGuiRect); SetRectFromGui(((Graphic)_pickIconHandle).rectTransform, new Rect(((Rect)(ref _pickGuiRect)).x + 11f, ((Rect)(ref _pickGuiRect)).y + 6f, 5f, 18f)); SetRectFromGui(((Graphic)_pickIconTip).rectTransform, new Rect(((Rect)(ref _pickGuiRect)).x + 17f, ((Rect)(ref _pickGuiRect)).y + 17f, 6f, 6f)); num6 += 40f; float num12 = 344f; float num13 = num5 + (num - num12) / 2f; _useGuiRect = new Rect(num13, num6, 118f, 44f); _saveGuiRect = new Rect(num13 + 126f, num6, 118f, 44f); _cancelGuiRect = new Rect(num13 + 252f, num6, 92f, 44f); SetRectFromGui(_useRt, _useGuiRect); SetRectFromGui(_saveRt, _saveGuiRect); SetRectFromGui(_cancelRt, _cancelGuiRect); } private void SyncCanvasUi() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_026b: Unknown result type (might be due to invalid IL or missing references) //IL_0271: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_02b3: Unknown result type (might be due to invalid IL or missing references) //IL_02b9: Unknown result type (might be due to invalid IL or missing references) //IL_02c1: Unknown result type (might be due to invalid IL or missing references) //IL_02d5: Unknown result type (might be due to invalid IL or missing references) //IL_02db: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) ((Graphic)_toggleBg).color = (_customMode ? ColAccent : ColDark); _toggleText.text = (_customMode ? "S" : "C"); if (!_customMode) { HideCustomPaletteVisuals(); SetPickerGraphicsVisible(visible: false); return; } Vector2 guiPos; bool flag = TryGetCurrentGuiPointer(out guiPos); ((Graphic)_plusBg).color = ((flag && ((Rect)(ref _plusGuiRect)).Contains(guiPos)) ? ColAccent : ColDark); SetTrashVisual(flag, guiPos); int num = Mathf.Min((_savedColors != null) ? _savedColors.Count : 0, _swatchViews.Count); for (int i = 0; i < num; i++) { CanvasSwatch canvasSwatch = _swatchViews[i]; ((Graphic)canvasSwatch.Fill).color = _savedColors[i]; Rect val; int num2; if (_deleteMode && flag && i < _swatchGuiRects.Count) { val = _swatchGuiRects[i]; num2 = (((Rect)(ref val)).Contains(guiPos) ? 1 : 0); } else { num2 = 0; } bool flag2 = (byte)num2 != 0; ((Graphic)canvasSwatch.Border).color = (flag2 ? ColDanger : Color.white); ((Component)canvasSwatch.Border).gameObject.SetActive(i == _selectedIdx || flag2); int num3; if (flag && i < _swatchGuiRects.Count) { val = _swatchGuiRects[i]; num3 = (((Rect)(ref val)).Contains(guiPos) ? 1 : 0); } else { num3 = 0; } bool flag3 = (byte)num3 != 0; ((Component)canvasSwatch.DeleteRoot).gameObject.SetActive(_customMode && !_deleteMode && flag3); } if (!_open) { SetPickerGraphicsVisible(visible: false); return; } RebuildSvTexIfNeeded(); _svRaw.texture = (Texture)(object)_svTex; _hueRaw.texture = (Texture)(object)EnsureHueTex(); ((Graphic)_previewImage).color = new Color(_r, _g, _b, 1f); SetPickerGraphicsVisible(visible: true); if ((Object)(object)_hexField != (Object)null && !_hexField.isFocused && _hexField.text != _hexInput) { _syncingHexField = true; _hexField.text = _hexInput; _syncingHexField = false; } SetActionVisual(_useBg, _useText, _useGuiRect, flag, guiPos); if ((Object)(object)_saveText != (Object)null) { _saveText.text = ((_editingSavedColorIndex >= 0) ? "Update Color" : "Save Color"); } SetActionVisual(_saveBg, _saveText, _saveGuiRect, flag, guiPos); SetEyedropperVisual(flag, guiPos); SetActionVisual(_cancelBg, _cancelText, _cancelGuiRect, flag, guiPos); } private void SetEyedropperVisual(bool havePointer, Vector2 pointer) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) bool flag = havePointer && ((Rect)(ref _pickGuiRect)).Contains(pointer); ((Graphic)_pickBg).color = (flag ? ColAccent : ColDark); ((Graphic)_pickIconHandle).color = (flag ? Color.white : ColBody); ((Graphic)_pickIconTip).color = (flag ? Color.white : ColBody); } private void SetTrashVisual(bool havePointer, Vector2 pointer) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)_trashBg == (Object)null)) { bool flag = havePointer && ((Rect)(ref _trashGuiRect)).Contains(pointer); Color color = ((_deleteMode || flag) ? Color.white : ColBody); ((Graphic)_trashBg).color = (_deleteMode ? ColDanger : (flag ? ColBtnHov : ColDark)); ((Graphic)_trashCanBody).color = color; ((Graphic)_trashCanLid).color = color; } } private void SetActionVisual(Image bg, Text text, Rect rect, bool havePointer, Vector2 pointer) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) ((Graphic)bg).color = ((havePointer && ((Rect)(ref rect)).Contains(pointer)) ? ColBtnHov : ColBtn); ((Graphic)text).color = ColBtnText; } private void EnsureSwatchViews() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) int num = Mathf.Max(0, _maxColors); while (_swatchViews.Count < num) { Image val = NewImage("SavedColor", Color.white); Image val2 = NewImage("SavedColorBorder", Color.white); Image val3 = NewImage("SavedColorEdit", ColDark); Text deleteText = NewText("SavedColorEditText", "E", 11, (TextAnchor)4, Color.white, (Transform)(object)((Graphic)val3).rectTransform); ((Component)val2).transform.SetSiblingIndex(((Component)val).transform.GetSiblingIndex()); ((Component)val3).transform.SetAsLastSibling(); ((Component)val).gameObject.SetActive(false); ((Component)val2).gameObject.SetActive(false); ((Component)val3).gameObject.SetActive(false); _swatchViews.Add(new CanvasSwatch { Root = ((Graphic)val).rectTransform, Fill = val, Border = val2, DeleteRoot = ((Graphic)val3).rectTransform, DeleteBg = val3, DeleteText = deleteText }); } } private void SetRectFromGui(RectTransform rt, Rect guiRect) { //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)rt == (Object)null) && !((Object)(object)_canvasRect == (Object)null)) { Camera val = CanvasCamera(); Vector2 val2 = default(Vector2); ((Vector2)(ref val2))..ctor(((Rect)(ref guiRect)).x + ((Rect)(ref guiRect)).width * 0.5f, (float)Screen.height - (((Rect)(ref guiRect)).y + ((Rect)(ref guiRect)).height * 0.5f)); Vector2 anchoredPosition = default(Vector2); if (RectTransformUtility.ScreenPointToLocalPointInRectangle(_canvasRect, val2, val, ref anchoredPosition)) { Vector2 val3 = default(Vector2); RectTransformUtility.ScreenPointToLocalPointInRectangle(_canvasRect, val2 + Vector2.left * ((Rect)(ref guiRect)).width * 0.5f, val, ref val3); Vector2 val4 = default(Vector2); RectTransformUtility.ScreenPointToLocalPointInRectangle(_canvasRect, val2 + Vector2.right * ((Rect)(ref guiRect)).width * 0.5f, val, ref val4); Vector2 val5 = default(Vector2); RectTransformUtility.ScreenPointToLocalPointInRectangle(_canvasRect, val2 + Vector2.up * ((Rect)(ref guiRect)).height * 0.5f, val, ref val5); Vector2 val6 = default(Vector2); RectTransformUtility.ScreenPointToLocalPointInRectangle(_canvasRect, val2 + Vector2.down * ((Rect)(ref guiRect)).height * 0.5f, val, ref val6); Vector2 val7 = default(Vector2); ((Vector2)(ref val7))..ctor(0.5f, 0.5f); rt.anchorMax = val7; rt.anchorMin = val7; rt.pivot = new Vector2(0.5f, 0.5f); rt.anchoredPosition = anchoredPosition; rt.sizeDelta = new Vector2(Mathf.Abs(val4.x - val3.x), Mathf.Abs(val5.y - val6.y)); } } } private Camera CanvasCamera() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_uiCanvas == (Object)null || (int)_uiCanvas.renderMode == 0) { return null; } if ((Object)(object)_uiCanvas.worldCamera != (Object)null) { return _uiCanvas.worldCamera; } if ((Object)(object)_inventoryBookCache != (Object)null && (Object)(object)_inventoryBookCache.UiCamera != (Object)null) { return _inventoryBookCache.UiCamera; } return Camera.main; } private Camera InventoryLayoutCamera() { if ((Object)(object)_inventoryBookCache != (Object)null && (Object)(object)_inventoryBookCache.UiCamera != (Object)null) { return _inventoryBookCache.UiCamera; } return Camera.main; } private void HandleCanvasInput() { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) if (Input.GetMouseButtonDown(0)) { HandlePointerPress(new Vector2(Input.mousePosition.x, (float)Screen.height - Input.mousePosition.y), isMouse: true); } if (Input.GetMouseButton(0) && (_svDragging || _hueDragging)) { UpdatePickerDrag(new Vector2(Input.mousePosition.x, (float)Screen.height - Input.mousePosition.y)); } if (Input.GetMouseButtonUp(0)) { _svDragging = false; _hueDragging = false; } if (_acceptPressedFrame >= Time.frameCount - 1 && _acceptConsumedFrame != _acceptPressedFrame && TryGetControllerGuiPointer(out var guiPos) && HandlePointerPress(guiPos, isMouse: false)) { _acceptConsumedFrame = _acceptPressedFrame; } if (_acceptHeld && (_svDragging || _hueDragging) && TryGetControllerGuiPointer(out guiPos)) { UpdatePickerDrag(guiPos); } if (_acceptReleasedFrame >= Time.frameCount - 1) { _svDragging = false; _hueDragging = false; } } private bool HandlePointerPress(Vector2 guiPos, bool isMouse) { //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_0205: Unknown result type (might be due to invalid IL or missing references) //IL_0250: Unknown result type (might be due to invalid IL or missing references) //IL_0268: Unknown result type (might be due to invalid IL or missing references) if (_open) { if (((Rect)(ref _svGuiRect)).Contains(guiPos)) { _svDragging = true; UpdatePickerDrag(guiPos); return true; } if (((Rect)(ref _hueGuiRect)).Contains(guiPos)) { _hueDragging = true; UpdatePickerDrag(guiPos); return true; } if (((Rect)(ref _hexGuiRect)).Contains(guiPos)) { if ((Object)(object)_hexField != (Object)null) { _hexField.ActivateInputField(); } return true; } if (((Rect)(ref _useGuiRect)).Contains(guiPos)) { UseColor(); return true; } if (((Rect)(ref _saveGuiRect)).Contains(guiPos)) { SaveColor(); return true; } if (((Rect)(ref _pickGuiRect)).Contains(guiPos)) { StartEyedropperMode(); return true; } if (((Rect)(ref _cancelGuiRect)).Contains(guiPos)) { _editingSavedColorIndex = -1; _open = false; return true; } if (((Rect)(ref _panelGuiRect)).Contains(guiPos)) { return true; } } if (((Rect)(ref _toggleGuiRect)).Contains(guiPos)) { _customMode = !_customMode; if (_customMode) { HideNativeButtons(); } else { _open = false; _deleteMode = false; _editingSavedColorIndex = -1; HideCustomPaletteVisuals(); ShowNativeButtons(); } return true; } if (!_customMode) { return false; } if ((Object)(object)_trashRt != (Object)null && ((Component)_trashRt).gameObject.activeSelf && ((Rect)(ref _trashGuiRect)).Contains(guiPos)) { _deleteMode = !_deleteMode; _editingSavedColorIndex = -1; if (_deleteMode) { ShowUserMessage("OCC: delete mode. Click one saved color to remove it."); } return true; } int num = 0; Rect val; while (!_deleteMode && num < _editGuiRects.Count) { val = _editGuiRects[num]; if (((Rect)(ref val)).Contains(guiPos)) { BeginEditSavedColor(num); return true; } num++; } for (int i = 0; i < _swatchGuiRects.Count; i++) { val = _swatchGuiRects[i]; if (((Rect)(ref val)).Contains(guiPos)) { if (_deleteMode) { DeleteSavedColor(i); return true; } SendColorChange(_savedColors[i]); _selectedIdx = i; return true; } } if ((Object)(object)_plusRt != (Object)null && ((Component)_plusRt).gameObject.activeSelf && ((Rect)(ref _plusGuiRect)).Contains(guiPos)) { _deleteMode = false; _editingSavedColorIndex = -1; Open(_lastDisplayColor); return true; } return false; } private void StartEyedropperMode() { //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Expected O, but got Unknown if (!TryGetInventoryCursorForRequest(out var cursor) || (Object)(object)cursor == (Object)null) { ShowUserMessage("OCC: no inventory cursor found for color pick."); return; } _eyedropperController = ((((Cursor)cursor).LocalPlayer != null) ? ((Cursor)cursor).LocalPlayer.UseController : _acceptSender); _eyedropperPlayerNumber = ((Cursor)cursor).networkNumber; _pendingColorPageNumber = ((_allColorBtns != null && _allColorBtns.Length != 0 && (Object)(object)_allColorBtns[0] != (Object)null) ? ((PickableButton)_allColorBtns[0]).PageNumber : (((Object)(object)_inventoryBookCache != (Object)null) ? _inventoryBookCache.currentPage : (-1))); _eyedropperActive = true; _eyedropperCancelQueued = false; _pendingReopenPicker = false; _reopenGotoRequested = false; _open = false; SetPickerGraphicsVisible(visible: false); SetCanvasVisible(visible: false); GameEventManager.SendEvent((GameEvent)new PlayerInventoryEvent(false, _eyedropperPlayerNumber, false)); HideInventoryCursorForEyedropper(cursor); ShowUserMessage("OCC eyedropper: hover a block and click to copy. Empty click or Back cancels. Escape is disabled in this mode."); } private void BeginEditSavedColor(int index) { //IL_0038: Unknown result type (might be due to invalid IL or missing references) if (_savedColors != null && index >= 0 && index < _savedColors.Count) { _deleteMode = false; _editingSavedColorIndex = index; _selectedIdx = index; Open(_savedColors[index]); ShowUserMessage("OCC: editing saved color. Update Color replaces this slot."); } } private void DeleteSavedColor(int index) { if (_savedColors != null && index >= 0 && index < _savedColors.Count) { _savedColors.RemoveAt(index); if (_selectedIdx == index) { _selectedIdx = -1; } else if (_selectedIdx > index) { _selectedIdx--; } if (_editingSavedColorIndex == index) { _editingSavedColorIndex = -1; } else if (_editingSavedColorIndex > index) { _editingSavedColorIndex--; } SaveColors(); _deleteMode = false; ShowUserMessage("OCC: deleted saved color."); } } private void HideInventoryCursorForEyedropper(PickCursor cursor) { if (!((Object)(object)cursor == (Object)null)) { if (((Cursor)cursor).hoveredPick != null) { ((Cursor)cursor).hoveredPick.IHoveredCursors.Remove((Cursor)(object)cursor); ((Cursor)cursor).hoveredPick = null; } ((Cursor)cursor).Disable(false, false); } } private bool TryGetInventoryCursorForRequest(out PickCursor cursor) { cursor = null; if ((Object)(object)_inventoryBookCache == (Object)null || _inventoryBookCache.cursors == null) { return false; } for (int i = 0; i < _inventoryBookCache.cursors.Count; i++) { PickCursor val = _inventoryBookCache.cursors[i]; if (!((Object)(object)val == (Object)null)) { if ((Object)(object)_acceptSender != (Object)null && ((Cursor)val).LocalPlayer != null && (Object)(object)((Cursor)val).LocalPlayer.UseController == (Object)(object)_acceptSender) { cursor = val; return true; } if ((Object)(object)cursor == (Object)null) { cursor = val; } } } return (Object)(object)cursor != (Object)null; } private void HandlePendingPickerReopen() { if (!_pendingReopenPicker || (Object)(object)_inventoryBookCache == (Object)null || !_inventoryBookCache.Visible) { return; } if (_pendingColorPageNumber >= 0 && !_inventoryBookCache.ScreenMode && _inventoryBookCache.currentPage != _pendingColorPageNumber) { if (!_reopenGotoRequested) { _inventoryBookCache.GotoPage(_pendingColorPageNumber, false, false); _reopenGotoRequested = true; } } else if (_layoutReady && IsColorPageActive()) { _customMode = true; _open = true; _pendingReopenPicker = false; _reopenGotoRequested = false; } } public bool HandleEyedropperWorldAccept(PiecePlacementCursor cursor) { //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Expected O, but got Unknown if (!_eyedropperActive || (Object)(object)cursor == (Object)null || !EyedropperMatchesCursor(cursor)) { return false; } if ((Object)(object)cursor.Piece != (Object)null) { ShowUserMessage("OCC: place or drop the held block before picking a color."); return true; } Placeable hoveredPiece = ((Cursor)cursor).hoveredPiece; if ((Object)(object)hoveredPiece == (Object)null || !hoveredPiece.canSetCustomColor || hoveredPiece.MarkedForDestruction || hoveredPiece.PickedUp) { CancelEyedropperMode(reopenPicker: true, ((Object)(object)hoveredPiece == (Object)null) ? "OCC: no block selected; color pick cancelled." : "OCC: that block has no custom color; color pick cancelled."); return true; } Color val = default(Color); ((Color)(ref val))..ctor(hoveredPiece.CustomColor.r, hoveredPiece.CustomColor.g, hoveredPiece.CustomColor.b, 1f); Color currentDisplayColor = ToDisplayColor(val); SetCurrentDisplayColor(currentDisplayColor); _lastBackendColor = val; _lastBackendHex = ToHex(val.r, val.g, val.b); _eyedropperActive = false; _eyedropperController = null; _pendingReopenPicker = true; _reopenGotoRequested = false; _customMode = true; _open = true; GameEventManager.SendEvent((GameEvent)new PlayerInventoryEvent(true, _eyedropperPlayerNumber, false)); ShowUserMessage("OCC: picked #" + _lastDisplayHex + "."); return true; } private bool EyedropperMatchesCursor(PiecePlacementCursor cursor) { if (_eyedropperPlayerNumber > 0) { return ((Cursor)cursor).networkNumber == _eyedropperPlayerNumber; } if ((Object)(object)_eyedropperController != (Object)null && ((Cursor)cursor).LocalPlayer != null) { return (Object)(object)((Cursor)cursor).LocalPlayer.UseController == (Object)(object)_eyedropperController; } return true; } private void CancelEyedropperMode(bool reopenPicker) { CancelEyedropperMode(reopenPicker, "OCC: color pick cancelled."); } private void CancelEyedropperMode(bool reopenPicker, string message) { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Expected O, but got Unknown if (_eyedropperActive) { ClearEyedropperStateOnly(); if (reopenPicker && _eyedropperPlayerNumber > 0) { _pendingReopenPicker = true; _reopenGotoRequested = false; _customMode = true; _open = true; GameEventManager.SendEvent((GameEvent)new PlayerInventoryEvent(true, _eyedropperPlayerNumber, false)); } ShowUserMessage(message); } } private void ClearEyedropperStateOnly() { _eyedropperActive = false; _eyedropperCancelQueued = false; _eyedropperController = null; } private void QueueEyedropperCancel(string message) { if (!_eyedropperCancelQueued) { _eyedropperCancelQueued = true; ((MonoBehaviour)this).StartCoroutine(CancelEyedropperNextFrame(message)); } } private IEnumerator CancelEyedropperNextFrame(string message) { yield return null; _eyedropperCancelQueued = false; if (_eyedropperActive) { CancelEyedropperMode(reopenPicker: true, message); } } private void SetCurrentDisplayColor(Color display) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) _r = display.r; _g = display.g; _b = display.b; Color.RGBToHSV(display, ref _h, ref _s, ref _v); _lastHueForSvTex = -1f; _lastDisplayColor = new Color(_r, _g, _b, 1f); _lastDisplayHex = ToHex(_r, _g, _b); _hexInput = _lastDisplayHex; } private void ShowUserMessage(string message) { if ((Object)(object)UserMessageManager.Instance != (Object)null) { UserMessageManager.Instance.UserMessage(message, false); } Plugin.Log.LogInfo((object)("[OssieCustomColors] " + message)); } private void UpdatePickerDrag(Vector2 guiPos) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) if (_svDragging) { _s = Mathf.Clamp01((guiPos.x - ((Rect)(ref _svGuiRect)).x) / ((Rect)(ref _svGuiRect)).width); _v = Mathf.Clamp01(1f - (guiPos.y - ((Rect)(ref _svGuiRect)).y) / ((Rect)(ref _svGuiRect)).height); UpdateRgbFromHsv(); } else if (_hueDragging) { _h = Mathf.Clamp01((guiPos.x - ((Rect)(ref _hueGuiRect)).x) / ((Rect)(ref _hueGuiRect)).width); _lastHueForSvTex = -1f; UpdateRgbFromHsv(); } } private void OnHexFieldChanged(string entered) { //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) if (!_syncingHexField) { _hexInput = NormalizeHex(entered); if ((Object)(object)_hexField != (Object)null && _hexField.text != _hexInput) { _syncingHexField = true; _hexField.text = _hexInput; _syncingHexField = false; _hexField.MoveTextEnd(false); } Color val = default(Color); if (ColorUtility.TryParseHtmlString("#" + _hexInput, ref val)) { _r = val.r; _g = val.g; _b = val.b; Color.RGBToHSV(val, ref _h, ref _s, ref _v); _lastHueForSvTex = -1f; } } } private bool TryGetCurrentGuiPointer(out Vector2 guiPos) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) if (TryGetControllerGuiPointer(out guiPos)) { return true; } guiPos = new Vector2(Input.mousePosition.x, (float)Screen.height - Input.mousePosition.y); return true; } private bool TryGetControllerGuiPointer(out Vector2 guiPos) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) guiPos = Vector2.zero; if ((Object)(object)_inventoryBookCache == (Object)null || _inventoryBookCache.cursors == null) { return false; } PickCursor val = null; for (int i = 0; i < _inventoryBookCache.cursors.Count; i++) { PickCursor val2 = _inventoryBookCache.cursors[i]; if (!((Object)(object)val2 == (Object)null) && ((Component)val2).gameObject.activeInHierarchy) { if ((Object)(object)_acceptSender != (Object)null && ((Cursor)val2).LocalPlayer != null && (Object)(object)((Cursor)val2).LocalPlayer.UseController == (Object)(object)_acceptSender) { val = val2; break; } if ((Object)(object)val == (Object)null) { val = val2; } } } if ((Object)(object)val == (Object)null) { return false; } Camera val3 = (((Object)(object)((Cursor)val).UseCamera != (Object)null) ? ((Cursor)val).UseCamera : (((Object)(object)_inventoryBookCache.UiCamera != (Object)null) ? _inventoryBookCache.UiCamera : Camera.main)); if ((Object)(object)val3 == (Object)null) { return false; } Vector3 val4 = (((Object)(object)val.cursorPoint != (Object)null) ? val.cursorPoint.position : ((Component)val).transform.position); Vector3 val5 = val3.WorldToScreenPoint(val4); if (val5.z < 0f) { return false; } guiPos = new Vector2(val5.x, (float)Screen.height - val5.y); return true; } public void ReceiveEvent(InputEvent e) { //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Invalid comparison between Unknown and I4 //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Invalid comparison between Unknown and I4 //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Invalid comparison between Unknown and I4 //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 if (e == null) { return; } if (_eyedropperActive && e.Changed && e.Valueb && ((int)e.Key == 34 || (int)e.Key == 19)) { e.Consume(); } else if (_eyedropperActive && e.Changed && e.Valueb && (int)e.Key == 22) { QueueEyedropperCancel("OCC: color pick cancelled."); e.Consume(); } else { if ((int)e.Key != 21 || (Object)(object)e.Sender == (Object)null || (e.Sender.IsKeyboard && e.Sender.IsUsingPosition())) { return; } _acceptSender = e.Sender; _acceptHeld = e.Valueb; if (e.Changed) { if (e.Valueb) { _acceptPressedFrame = Time.frameCount; } else { _acceptReleasedFrame = Time.frameCount; } } } } private void UpdateRgbFromHsv() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) Color val = Color.HSVToRGB(_h, _s, _v); _r = val.r; _g = val.g; _b = val.b; _hexInput = ToHex(_r, _g, _b); } private void RebuildSvTexIfNeeded() { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Expected O, but got Unknown //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_svTex != (Object)null && Mathf.Abs(_lastHueForSvTex - _h) < 0.002f) { return; } _lastHueForSvTex = _h; if ((Object)(object)_svTex == (Object)null) { _svTex = new Texture2D(64, 64, (TextureFormat)3, false); ((Object)_svTex).hideFlags = (HideFlags)61; ((Texture)_svTex).filterMode = (FilterMode)1; ((Texture)_svTex).wrapMode = (TextureWrapMode)1; } if (_svPixels == null || _svPixels.Length != 4096) { _svPixels = (Color[])(object)new Color[4096]; } for (int i = 0; i < 64; i++) { for (int j = 0; j < 64; j++) { _svPixels[i * 64 + j] = Color.HSVToRGB(_h, (float)j / 63f, (float)i / 63f); } } _svTex.SetPixels(_svPixels); _svTex.Apply(); } private Texture2D EnsureHueTex() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_hueTex != (Object)null) { return _hueTex; } _hueTex = new Texture2D(256, 16, (TextureFormat)3, false); ((Object)_hueTex).hideFlags = (HideFlags)61; ((Texture)_hueTex).filterMode = (FilterMode)1; ((Texture)_hueTex).wrapMode = (TextureWrapMode)1; Color[] array = (Color[])(object)new Color[4096]; for (int i = 0; i < 16; i++) { for (int j = 0; j < 256; j++) { array[i * 256 + j] = Color.HSVToRGB((float)j / 255f, 1f, 1f); } } _hueTex.SetPixels(array); _hueTex.Apply(); return _hueTex; } private void UseColor() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) SendColorChange(new Color(_r, _g, _b, 1f)); _editingSavedColorIndex = -1; _open = false; } private void SaveColor() { //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) Color val = default(Color); ((Color)(ref val))..ctor(_r, _g, _b, 1f); if (_editingSavedColorIndex >= 0 && _editingSavedColorIndex < _savedColors.Count) { _savedColors[_editingSavedColorIndex] = val; _selectedIdx = _editingSavedColorIndex; SaveColors(); SendColorChange(val); _open = false; Plugin.Log.LogInfo((object)$"[OssieCustomColors] Updated #{ToHex(_r, _g, _b)} at {_editingSavedColorIndex}"); _editingSavedColorIndex = -1; } else { _savedColors.Add(val); _selectedIdx = _savedColors.Count - 1; SaveColors(); SendColorChange(val); _open = false; _editingSavedColorIndex = -1; Plugin.Log.LogInfo((object)$"[OssieCustomColors] Saved #{ToHex(_r, _g, _b)}, count={_savedColors.Count}"); } } private void SendColorChange(Color displayColor) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Expected O, but got Unknown _lastDisplayColor = displayColor; _lastDisplayHex = ToHex(displayColor.r, displayColor.g, displayColor.b); Color backendColor; bool flag = TryGetCalibratedBackend(displayColor, out backendColor); if (!flag) { backendColor = ToGameColor(displayColor); } _lastBackendColor = backendColor; _lastBackendHex = ToHex(backendColor.r, backendColor.g, backendColor.b); if (!_loggedColorSpace) { _loggedColorSpace = true; Plugin.Log.LogInfo((object)$"[OssieCustomColors] Color space: {QualitySettings.activeColorSpace}"); } Plugin.Log.LogInfo((object)(flag ? ("[OssieCustomColors] Sending display #" + _lastDisplayHex + " as calibrated backend #" + _lastBackendHex) : $"[OssieCustomColors] Sending display #{_lastDisplayHex} as backend #{_lastBackendHex} using exponent {Plugin.ColorCorrectionExponent.Value:F2}, brightness {Mathf.Clamp01(Plugin.ColorCorrectionBrightness.Value):F2}")); GameEventManager.SendEvent((GameEvent)new SetpieceColorChangeEvent(backendColor)); } private void LoadColors() { //IL_0056: Unknown result type (might be due to invalid IL or missing references) _savedColors = new List(); string[] array = Plugin.SavedColors.Value.Split(new char[1] { ',' }); Color item = default(Color); for (int i = 0; i < array.Length; i++) { string text = array[i].Trim(); if (text.Length > 0 && ColorUtility.TryParseHtmlString("#" + text, ref item)) { _savedColors.Add(item); } } } private void SaveColors() { Plugin.SavedColors.Value = string.Join(",", _savedColors.ConvertAll((Color c) => ToHex(c.r, c.g, c.b))); } private void RefreshSwatch() { //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Expected O, but got Unknown if ((Object)(object)_texSwatch == (Object)null) { _texSwatch = new Texture2D(1, 1) { hideFlags = (HideFlags)61 }; } _texSwatch.SetPixel(0, 0, new Color(_r, _g, _b, 1f)); _texSwatch.Apply(); } private bool TryGetCalibratedBackend(Color displayColor, out Color backendColor) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) string key = ToHex(displayColor.r, displayColor.g, displayColor.b); if (_calibratedBackendColors.TryGetValue(key, out backendColor)) { return true; } if (LutData.Entries.TryGetValue(key, out backendColor)) { return true; } if (_calibratedBackendColors.Count + LutData.Entries.Count < 4) { backendColor = Color.black; return false; } int num = 0; foreach (KeyValuePair calibratedBackendColor in _calibratedBackendColors) { num = ConsiderLutNeighbor(displayColor, calibratedBackendColor.Key, calibratedBackendColor.Value, num); } foreach (KeyValuePair entry in LutData.Entries) { if (!_calibratedBackendColors.ContainsKey(entry.Key)) { num = ConsiderLutNeighbor(displayColor, entry.Key, entry.Value, num); } } if (num == 0) { backendColor = Color.black; return false; } if (_nearestDistances[0] <= 1E-06f) { backendColor = _nearestBackendColors[0]; return true; } float num2 = 0f; Color val = Color.black; for (int i = 0; i < num; i++) { float num3 = 1f / Mathf.Max(1E-06f, _nearestDistances[i]); val += _nearestBackendColors[i] * num3; num2 += num3; } backendColor = new Color(val.r / num2, val.g / num2, val.b / num2, 1f); return true; } private int ConsiderLutNeighbor(Color displayColor, string displayHex, Color backend, int nearestCount) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) float num = ColorDistanceSq(displayColor, HexToColor(displayHex)); int num2 = nearestCount; while (num2 > 0 && num < _nearestDistances[num2 - 1]) { num2--; } if (num2 >= _nearestDistances.Length) { return nearestCount; } for (int num3 = Mathf.Min(nearestCount, _nearestDistances.Length - 1); num3 > num2; num3--) { _nearestDistances[num3] = _nearestDistances[num3 - 1]; _nearestBackendColors[num3] = _nearestBackendColors[num3 - 1]; } _nearestDistances[num2] = num; _nearestBackendColors[num2] = backend; return Mathf.Min(nearestCount + 1, _nearestDistances.Length); } private Color ToDisplayColor(Color backendColor) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) if (TryGetDisplayFromBackend(backendColor, out var displayColor)) { return displayColor; } return FromGameColor(backendColor); } private bool TryGetDisplayFromBackend(Color backendColor, out Color displayColor) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_022c: Unknown result type (might be due to invalid IL or missing references) //IL_0231: Unknown result type (might be due to invalid IL or missing references) //IL_020f: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Unknown result type (might be due to invalid IL or missing references) //IL_0252: Unknown result type (might be due to invalid IL or missing references) //IL_025b: Unknown result type (might be due to invalid IL or missing references) //IL_0262: Unknown result type (might be due to invalid IL or missing references) //IL_0267: Unknown result type (might be due to invalid IL or missing references) //IL_026c: Unknown result type (might be due to invalid IL or missing references) //IL_027e: Unknown result type (might be due to invalid IL or missing references) //IL_0286: Unknown result type (might be due to invalid IL or missing references) //IL_028e: Unknown result type (might be due to invalid IL or missing references) //IL_029b: Unknown result type (might be due to invalid IL or missing references) //IL_02a0: Unknown result type (might be due to invalid IL or missing references) string text = ToHex(backendColor.r, backendColor.g, backendColor.b); foreach (KeyValuePair calibratedBackendColor in _calibratedBackendColors) { if (ToHex(calibratedBackendColor.Value.r, calibratedBackendColor.Value.g, calibratedBackendColor.Value.b) == text) { displayColor = HexToColor(calibratedBackendColor.Key); displayColor.a = 1f; return true; } } foreach (KeyValuePair entry in LutData.Entries) { if (!_calibratedBackendColors.ContainsKey(entry.Key) && ToHex(entry.Value.r, entry.Value.g, entry.Value.b) == text) { displayColor = HexToColor(entry.Key); displayColor.a = 1f; return true; } } int num = 0; foreach (KeyValuePair calibratedBackendColor2 in _calibratedBackendColors) { num = ConsiderBackendNeighbor(backendColor, HexToColor(calibratedBackendColor2.Key), calibratedBackendColor2.Value, num); } foreach (KeyValuePair entry2 in LutData.Entries) { if (!_calibratedBackendColors.ContainsKey(entry2.Key)) { num = ConsiderBackendNeighbor(backendColor, HexToColor(entry2.Key), entry2.Value, num); } } if (num == 0) { displayColor = Color.black; return false; } if (_nearestDistances[0] <= 1E-06f) { displayColor = _nearestDisplayColors[0]; displayColor.a = 1f; return true; } float num2 = 0f; Color val = Color.black; for (int i = 0; i < num; i++) { float num3 = 1f / Mathf.Max(1E-06f, _nearestDistances[i]); val += _nearestDisplayColors[i] * num3; num2 += num3; } displayColor = new Color(val.r / num2, val.g / num2, val.b / num2, 1f); return true; } private int ConsiderBackendNeighbor(Color backendColor, Color displayColor, Color candidateBackend, int nearestCount) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) float num = ColorDistanceSq(backendColor, candidateBackend); int num2 = nearestCount; while (num2 > 0 && num < _nearestDistances[num2 - 1]) { num2--; } if (num2 >= _nearestDistances.Length) { return nearestCount; } for (int num3 = Mathf.Min(nearestCount, _nearestDistances.Length - 1); num3 > num2; num3--) { _nearestDistances[num3] = _nearestDistances[num3 - 1]; _nearestDisplayColors[num3] = _nearestDisplayColors[num3 - 1]; } _nearestDistances[num2] = num; _nearestDisplayColors[num2] = displayColor; return Mathf.Min(nearestCount + 1, _nearestDistances.Length); } private static string ToHex(float r, float g, float b) { return $"{Mathf.RoundToInt(Mathf.Clamp01(r) * 255f):X2}{Mathf.RoundToInt(Mathf.Clamp01(g) * 255f):X2}{Mathf.RoundToInt(Mathf.Clamp01(b) * 255f):X2}"; } private static string NormalizeHex(string hex) { return new string(hex.Trim().TrimStart(new char[1] { '#' }).Where(UriStyleHexChar) .ToArray()).ToUpperInvariant(); } private static bool UriStyleHexChar(char c) { if ((c < '0' || c > '9') && (c < 'a' || c > 'f')) { if (c >= 'A') { return c <= 'F'; } return false; } return true; } private static string SafeHex(string hex) { if (!string.IsNullOrEmpty(hex)) { return hex; } return "------"; } private static float ColorDistanceSq(Color a, Color b) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) float num = a.r - b.r; float num2 = a.g - b.g; float num3 = a.b - b.b; return num * num + num2 * num2 + num3 * num3; } private static Color HexToColor(string hex) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) Color result = default(Color); ColorUtility.TryParseHtmlString("#" + hex, ref result); return result; } private static Color ToGameColor(Color displayColor) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) float num = Mathf.Max(0.01f, Plugin.ColorCorrectionExponent.Value); float num2 = Mathf.Clamp01(Plugin.ColorCorrectionBrightness.Value); return new Color(Mathf.Pow(displayColor.r, num) * num2, Mathf.Pow(displayColor.g, num) * num2, Mathf.Pow(displayColor.b, num) * num2, displayColor.a); } private static Color FromGameColor(Color backendColor) { //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) float num = Mathf.Max(0.01f, Plugin.ColorCorrectionExponent.Value); float num2 = Mathf.Clamp01(Plugin.ColorCorrectionBrightness.Value); if (num2 <= 1E-06f) { return new Color(Mathf.Clamp01(backendColor.r), Mathf.Clamp01(backendColor.g), Mathf.Clamp01(backendColor.b), 1f); } float num3 = 1f / num; return new Color(Mathf.Pow(Mathf.Clamp01(backendColor.r / num2), num3), Mathf.Pow(Mathf.Clamp01(backendColor.g / num2), num3), Mathf.Pow(Mathf.Clamp01(backendColor.b / num2), num3), 1f); } private static Texture2D Solid(Color c) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown Texture2D val = new Texture2D(1, 1) { hideFlags = (HideFlags)61 }; val.SetPixel(0, 0, c); val.Apply(); return val; } private Font ResolveFont() { Font[] array = Resources.FindObjectsOfTypeAll(); foreach (Font val in array) { if ((Object)(object)val != (Object)null && ((Object)val).name.IndexOf("KGNexttoMe", StringComparison.OrdinalIgnoreCase) >= 0) { return val; } } return Resources.GetBuiltinResource("Arial.ttf"); } private void EnsureStyles() { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Expected O, but got Unknown //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Expected O, but got Unknown //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Expected O, but got Unknown //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Expected O, but got Unknown //IL_0188: Expected O, but got Unknown //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_0215: Unknown result type (might be due to invalid IL or missing references) //IL_0222: Expected O, but got Unknown //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_0234: Unknown result type (might be due to invalid IL or missing references) //IL_023c: Unknown result type (might be due to invalid IL or missing references) //IL_0248: Expected O, but got Unknown //IL_0253: Unknown result type (might be due to invalid IL or missing references) //IL_025e: Unknown result type (might be due to invalid IL or missing references) //IL_0263: Unknown result type (might be due to invalid IL or missing references) //IL_026f: Unknown result type (might be due to invalid IL or missing references) //IL_0277: Unknown result type (might be due to invalid IL or missing references) //IL_0283: Expected O, but got Unknown //IL_028e: Unknown result type (might be due to invalid IL or missing references) //IL_0299: Unknown result type (might be due to invalid IL or missing references) //IL_029e: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02b2: Unknown result type (might be due to invalid IL or missing references) //IL_02be: Expected O, but got Unknown //IL_02c9: Unknown result type (might be due to invalid IL or missing references) if (!_stylesReady) { Font val = ResolveFont(); if (!((Object)(object)val == (Object)null)) { _font = val; _texPanel = Solid(ColPanel); _texBtn = Solid(ColBtn); _texBtnHov = Solid(ColBtnHov); _texWhite = Solid(Color.white); _texDark = Solid(ColDark); _texAccent = Solid(ColAccent); _titleStyle = new GUIStyle { font = _font, fontSize = 20, alignment = (TextAnchor)4 }; _titleStyle.normal.textColor = ColTitle; _labelStyle = new GUIStyle { font = _font, fontSize = 18, alignment = (TextAnchor)3 }; _labelStyle.normal.textColor = ColBody; _fieldStyle = new GUIStyle(GUI.skin.textField) { font = _font, fontSize = 18, alignment = (TextAnchor)3 }; _fieldStyle.normal.textColor = ColBody; _fieldStyle.focused.textColor = ColTitle; _btnStyle = new GUIStyle { font = _font, fontSize = 20, alignment = (TextAnchor)4, padding = new RectOffset(10, 10, 6, 6) }; _btnStyle.normal.background = _texBtn; _btnStyle.normal.textColor = ColBtnText; _btnStyle.hover.background = _texBtnHov; _btnStyle.hover.textColor = ColBtnText; _btnStyle.active.background = _texBtnHov; _btnStyle.active.textColor = ColBtnText; _actionBtnStyle = new GUIStyle(_btnStyle) { fontSize = 14 }; _toggleStyle = new GUIStyle { font = _font, fontSize = 16, alignment = (TextAnchor)4 }; _toggleStyle.normal.textColor = Color.white; _plusStyle = new GUIStyle { font = _font, fontSize = 24, alignment = (TextAnchor)4 }; _plusStyle.normal.textColor = Color.white; _xStyle = new GUIStyle { font = _font, fontSize = 11, alignment = (TextAnchor)4 }; _xStyle.normal.textColor = Color.white; _stylesReady = true; } } } private static Vector2 PointerPos(Event e) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return e.mousePosition; } private static bool PointerIn(Rect r, Event e) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) return ((Rect)(ref r)).Contains(e.mousePosition); } private static bool ControllerClick(Rect r) { return false; } } internal static class LutData { public static readonly Dictionary Entries = new Dictionary { { "000000", new Color(0f, 0f, 0f, 1f) }, { "000020", new Color(0f, 0f, 0.068866f, 1f) }, { "000040", new Color(0f, 0f, 0.136076f, 1f) }, { "000060", new Color(0f, 0f, 0.211126f, 1f) }, { "000080", new Color(0f, 0f, 0.27277f, 1f) }, { "00009F", new Color(0f, 0f, 0.34963f, 1f) }, { "0000BF", new Color(0f, 0f, 0.419029f, 1f) }, { "0000DF", new Color(0f, 0f, 0.490123f, 1f) }, { "0000FF", new Color(0f, 0f, 1f, 1f) }, { "002000", new Color(0f, 0.06839f, 0f, 1f) }, { "002020", new Color(0f, 0.068516f, 0.071648f, 1f) }, { "002040", new Color(0f, 0.068514f, 0.138804f, 1f) }, { "002060", new Color(0f, 0.068537f, 0.211217f, 1f) }, { "002080", new Color(0f, 0.068469f, 0.277345f, 1f) }, { "00209F", new Color(0f, 0.068532f, 0.348835f, 1f) }, { "0020BF", new Color(0f, 0.068462f, 0.420373f, 1f) }, { "0020DF", new Color(0f, 0.064606f, 0.485312f, 1f) }, { "0020FF", new Color(0f, 0.068135f, 1f, 1f) }, { "004000", new Color(0f, 0.127059f, 0f, 1f) }, { "004020", new Color(0f, 0.125003f, 0.068352f, 1f) }, { "004040", new Color(0f, 0.125155f, 0.136183f, 1f) }, { "004060", new Color(0f, 0.128903f, 0.211414f, 1f) }, { "004080", new Color(0f, 0.125163f, 0.2727f, 1f) }, { "00409F", new Color(0f, 0.127057f, 0.345544f, 1f) }, { "0040BF", new Color(0f, 0.128982f, 0.420072f, 1f) }, { "0040DF", new Color(0f, 0.129098f, 0.485773f, 1f) }, { "0040FF", new Color(0f, 0.1252f, 1f, 1f) }, { "006000", new Color(0f, 0.196277f, 0f, 1f) }, { "006020", new Color(0f, 0.196462f, 0.071569f, 1f) }, { "006040", new Color(0f, 0.196278f, 0.138664f, 1f) }, { "006060", new Color(0f, 0.196632f, 0.211329f, 1f) }, { "006080", new Color(0f, 0.196634f, 0.277332f, 1f) }, { "00609F", new Color(0f, 0.196544f, 0.34663f, 1f) }, { "0060BF", new Color(0f, 0.196673f, 0.420176f, 1f) }, { "0060DF", new Color(0f, 0.191963f, 0.490312f, 1f) }, { "0060FF", new Color(0f, 0.196819f, 1f, 1f) }, { "008000", new Color(0f, 0.254235f, 0f, 1f) }, { "008020", new Color(0f, 0.254789f, 0.070283f, 1f) }, { "008040", new Color(0f, 0.260425f, 0.140142f, 1f) }, { "008060", new Color(0f, 0.258695f, 0.209996f, 1f) }, { "008080", new Color(0f, 0.257682f, 0.279837f, 1f) }, { "00809F", new Color(0f, 0.257599f, 0.348091f, 1f) }, { "0080BF", new Color(0f, 0.260759f, 0.417672f, 1f) }, { "0080DF", new Color(0f, 0.260445f, 0.491646f, 1f) }, { "0080FF", new Color(0f, 0.259735f, 0.817213f, 1f) }, { "009F00", new Color(0f, 0.320098f, 0f, 1f) }, { "009F20", new Color(0f, 0.320266f, 0.06829f, 1f) }, { "009F40", new Color(0f, 0.31975f, 0.139532f, 1f) }, { "009F60", new Color(0f, 0.320864f, 0.208186f, 1f) }, { "009F80", new Color(0f, 0.319242f, 0.278211f, 1f) }, { "009F9F", new Color(0f, (float)Math.PI * 13f / 128f, 0.348905f, 1f) }, { "009FBF", new Color(0f, 0.318266f, 0.41524f, 1f) }, { "009FDF", new Color(0f, 0.317742f, 0.486096f, 1f) }, { "009FFF", new Color(0f, 0.320897f, 0.658081f, 1f) }, { "00BF00", new Color(0f, 0.386517f, 0f, 1f) }, { "00BF20", new Color(0f, 0.382365f, 0.070224f, 1f) }, { "00BF40", new Color(0f, 0.389799f, 0.142566f, 1f) }, { "00BF60", new Color(0f, 0.387888f, 0.207229f, 1f) }, { "00BF80", new Color(0f, 0.383009f, 0.277361f, 1f) }, { "00BF9F", new Color(0f, 0.388229f, 0.350209f, 1f) }, { "00BFBF", new Color(0f, 0.388391f, 0.419035f, 1f) }, { "00BFDF", new Color(0f, 0.389174f, 0.487652f, 1f) }, { "00BFFF", new Color(0f, 0.389947f, 0.561042f, 1f) }, { "00DF00", new Color(0f, 0.45181f, 0f, 1f) }, { "00DF20", new Color(0f, 0.445711f, 0.069715f, 1f) }, { "00DF40", new Color(0f, 0.447226f, 0.138692f, 1f) }, { "00DF60", new Color(0f, 0.452673f, 0.21189f, 1f) }, { "00DF80", new Color(0f, 0.445898f, 0.277618f, 1f) }, { "00DF9F", new Color(0f, 0.445447f, 0.347079f, 1f) }, { "00DFBF", new Color(0f, 0.452819f, 0.419749f, 1f) }, { "00DFDF", new Color(0f, 0.446019f, 0.487181f, 1f) }, { "00DFFF", new Color(0f, 0.447301f, 0.57213f, 1f) }, { "00FF00", new Color(0f, 0.555472f, 0f, 1f) }, { "00FF20", new Color(0f, 0.534233f, 0.067095f, 1f) }, { "00FF40", new Color(0f, 0.533298f, 0.140566f, 1f) }, { "00FF60", new Color(0f, 0.535334f, 0.206362f, 1f) }, { "00FF80", new Color(0f, 0.534951f, 0.277056f, 1f) }, { "00FF9F", new Color(0f, 0.535678f, 0.343852f, 1f) }, { "00FFBF", new Color(0f, 0.529774f, 0.41704f, 1f) }, { "00FFDF", new Color(0f, 0.539041f, 0.486017f, 1f) }, { "00FFFF", new Color(0f, 0.532806f, 0.573362f, 1f) }, { "200000", new Color(0.061187f, 0f, 0f, 1f) }, { "200020", new Color(0.063414f, 0f, 0.068978f, 1f) }, { "200040", new Color(0.061467f, 0f, 0.137425f, 1f) }, { "200060", new Color(0.063805f, 0f, 0.211185f, 1f) }, { "200080", new Color(0.06162f, 0f, 0.275965f, 1f) }, { "20009F", new Color(0.061431f, 0f, 0.344285f, 1f) }, { "2000BF", new Color(0.060838f, 0f, 0.41985f, 1f) }, { "2000DF", new Color(0.068447f, 0f, 0.487524f, 1f) }, { "2000FF", new Color(0.067294f, 0f, 0.699566f, 1f) }, { "202000", new Color(0.066397f, 0.068559f, 0f, 1f) }, { "202020", new Color(0.061209f, 0.063933f, 0.071603f, 1f) }, { "202040", new Color(0.068545f, 0.065744f, 0.136687f, 1f) }, { "202060", new Color(0.061898f, 0.063826f, 0.208851f, 1f) }, { "202080", new Color(0.063981f, 0.066143f, 0.278889f, 1f) }, { "20209F", new Color(0.064015f, 0.066509f, 0.350213f, 1f) }, { "2020BF", new Color(0.068377f, 0.06505f, 0.41588f, 1f) }, { "2020DF", new Color(0.06617f, 0.065189f, 0.482606f, 1f) }, { "2020FF", new Color(0.066993f, 0.067065f, 0.718908f, 1f) }, { "204000", new Color(0.064059f, 0.124603f, 0f, 1f) }, { "204020", new Color(0.061855f, 0.125384f, 0.071796f, 1f) }, { "204040", new Color(0.061714f, 0.125553f, 0.140999f, 1f) }, { "204060", new Color(0.061383f, 0.126554f, 0.208936f, 1f) }, { "204080", new Color(0.060943f, 0.126293f, 0.278679f, 1f) }, { "20409F", new Color(0.061267f, 0.12655f, 0.348675f, 1f) }, { "2040BF", new Color(0.061972f, 0.12672f, 0.418367f, 1f) }, { "2040DF", new Color(0.062359f, 0.126459f, 0.488613f, 1f) }, { "2040FF", new Color(0.066002f, 0.12997f, 0.723036f, 1f) }, { "206000", new Color(0.066186f, 0.1962f, 0f, 1f) }, { "206020", new Color(0.061557f, 0.194317f, 0.067898f, 1f) }, { "206040", new Color(0.063823f, 0.193891f, 0.138959f, 1f) }, { "206060", new Color(0.064021f, 0.194522f, 0.209463f, 1f) }, { "206080", new Color(0.064018f, 0.194382f, 0.279651f, 1f) }, { "20609F", new Color(0.064162f, 0.19464f, 0.345403f, 1f) }, { "2060BF", new Color(0.064121f, 0.194202f, 0.417177f, 1f) }, { "2060DF", new Color(0.06786f, 0.190429f, 0.488686f, 1f) }, { "2060FF", new Color(0.066587f, 0.195422f, 0.707787f, 1f) }, { "208000", new Color(0.067167f, 0.260707f, 0f, 1f) }, { "208020", new Color(0.065233f, 0.25848f, 0.068157f, 1f) }, { "208040", new Color(0.061384f, 0.255959f, 0.139766f, 1f) }, { "208060", new Color(0.061017f, 0.255852f, 0.209378f, 1f) }, { "208080", new Color(0.06082f, 0.255625f, 0.274976f, 1f) }, { "20809F", new Color(0.061341f, 0.255136f, 0.346832f, 1f) }, { "2080BF", new Color(0.061205f, 0.255378f, 0.419706f, 1f) }, { "2080DF", new Color(0.065227f, 0.257914f, 0.484861f, 1f) }, { "2080FF", new Color(0.066702f, 0.260596f, 0.655762f, 1f) }, { "209F00", new Color(0.064906f, 0.318314f, 0f, 1f) }, { "209F20", new Color(0.065262f, 0.322113f, 0.067872f, 1f) }, { "209F40", new Color(0.061256f, 0.321882f, 0.140809f, 1f) }, { "209F60", new Color(0.060807f, 0.318247f, 0.207165f, 1f) }, { "209F80", new Color(0.061018f, 0.316447f, 0.279602f, 1f) }, { "209F9F", new Color(0.061089f, 0.315882f, 0.346891f, 1f) }, { "209FBF", new Color(0.060971f, 0.316596f, 0.41518f, 1f) }, { "209FDF", new Color(0.06146f, 0.321143f, 0.48466f, 1f) }, { "209FFF", new Color(0.062811f, 0.318494f, 0.589077f, 1f) }, { "20BF00", new Color(0.06328f, 0.384783f, 0f, 1f) }, { "20BF20", new Color(0.068326f, 0.384196f, 0.071818f, 1f) }, { "20BF40", new Color(0.060985f, 0.383541f, 0.141493f, 1f) }, { "20BF60", new Color(0.068468f, 0.387727f, 0.20818f, 1f) }, { "20BF80", new Color(0.063284f, 0.388295f, 0.278586f, 1f) }, { "20BF9F", new Color(0.063349f, 0.387035f, 0.345369f, 1f) }, { "20BFBF", new Color(0.06861f, 0.388438f, 0.416905f, 1f) }, { "20BFDF", new Color(0.061232f, 0.384019f, 0.485521f, 1f) }, { "20BFFF", new Color(0.068254f, 0.383631f, 0.563965f, 1f) }, { "20DF00", new Color(0.063492f, 0.447066f, 0f, 1f) }, { "20DF20", new Color(0.061217f, 0.445226f, 0.071219f, 1f) }, { "20DF40", new Color(0.065064f, 0.445166f, 0.136656f, 1f) }, { "20DF60", new Color(0.06513f, 0.448914f, 0.207485f, 1f) }, { "20DF80", new Color(0.061535f, 0.447001f, 0.278838f, 1f) }, { "20DF9F", new Color(0.0614f, 0.45193f, 0.347855f, 1f) }, { "20DFBF", new Color(0.061088f, 0.4469f, 0.419487f, 1f) }, { "20DFDF", new Color(0.067735f, 0.449263f, 0.486084f, 1f) }, { "20DFFF", new Color(0.066217f, 0.447705f, 0.563624f, 1f) }, { "20FF00", new Color(0.066448f, 0.533362f, 0f, 1f) }, { "20FF20", new Color(0.06169f, 0.52391f, 0.071703f, 1f) }, { "20FF40", new Color(0.061352f, 0.521244f, 0.141271f, 1f) }, { "20FF60", new Color(0.061827f, 0.521761f, 0.207707f, 1f) }, { "20FF80", new Color(0.061403f, 0.521768f, 0.274424f, 1f) }, { "20FF9F", new Color(0.061177f, 0.521391f, 0.3454f, 1f) }, { "20FFBF", new Color(0.061265f, 0.521425f, 0.413882f, 1f) }, { "20FFDF", new Color(0.061139f, 0.522242f, 0.483832f, 1f) }, { "20FFFF", new Color(0.061981f, 0.52459f, 0.566869f, 1f) }, { "400000", new Color(0.124526f, 0f, 0f, 1f) }, { "400020", new Color(0.125053f, 0f, 0.069426f, 1f) }, { "400040", new Color(0.125354f, 0f, 0.137708f, 1f) }, { "400060", new Color(0.126754f, 0f, 0.208593f, 1f) }, { "400080", new Color(0.126612f, 0f, 0.278041f, 1f) }, { "40009F", new Color(0.126951f, 0f, 0.34711f, 1f) }, { "4000BF", new Color(0.127579f, 0f, 0.417364f, 1f) }, { "4000DF", new Color(0.127992f, 0f, 0.486485f, 1f) }, { "4000FF", new Color(0.124639f, 0f, 0.596333f, 1f) }, { "402000", new Color(0.130313f, 0.067896f, 0f, 1f) }, { "402020", new Color(0.127989f, 0.06604f, 0.068517f, 1f) }, { "402040", new Color(0.12778f, 0.065569f, 0.142183f, 1f) }, { "402060", new Color(0.123877f, 0.063011f, 0.207311f, 1f) }, { "402080", new Color(0.125721f, 0.061354f, 0.27891f, 1f) }, { "40209F", new Color(0.126694f, 0.061103f, 0.348356f, 1f) }, { "4020BF", new Color(0.127164f, 0.06694f, 0.419232f, 1f) }, { "4020DF", new Color(0.128022f, 0.062685f, 0.489668f, 1f) }, { "4020FF", new Color(0.130513f, 0.06682f, 0.593768f, 1f) }, { "404000", new Color(0.124909f, 0.129391f, 0f, 1f) }, { "404020", new Color(0.126016f, 0.125971f, 0.067948f, 1f) }, { "404040", new Color(0.126347f, 0.125429f, 0.141062f, 1f) }, { "404060", new Color(0.125157f, 0.124904f, 0.208898f, 1f) }, { "404080", new Color(0.12486f, 0.124136f, 0.279496f, 1f) }, { "40409F", new Color(0.125307f, 0.124429f, 0.34948f, 1f) }, { "4040BF", new Color(0.126217f, 0.125015f, 0.418763f, 1f) }, { "4040DF", new Color(0.124373f, 0.12358f, 0.489552f, 1f) }, { "4040FF", new Color(0.130312f, 0.129461f, 0.595052f, 1f) }, { "406000", new Color(0.124258f, 0.191331f, 0f, 1f) }, { "406020", new Color(0.125335f, 0.193507f, 0.071518f, 1f) }, { "406040", new Color(0.125697f, 0.193145f, 0.136409f, 1f) }, { "406060", new Color(0.125744f, 0.193145f, 0.209338f, 1f) }, { "406080", new Color(0.125576f, 0.19305f, 0.274856f, 1f) }, { "40609F", new Color(0.126001f, 0.193177f, 0.347882f, 1f) }, { "4060BF", new Color(0.12761f, 0.197781f, 0.416818f, 1f) }, { "4060DF", new Color(0.127399f, 0.193515f, 0.489491f, 1f) }, { "4060FF", new Color(0.131055f, 0.195518f, 0.588049f, 1f) }, { "408000", new Color(0.124683f, 0.257746f, 0f, 1f) }, { "408020", new Color(0.126059f, 0.255335f, 0.07105f, 1f) }, { "408040", new Color(0.125481f, 0.254331f, 0.14084f, 1f) }, { "408060", new Color(0.124931f, 0.253736f, 0.208513f, 1f) }, { "408080", new Color(0.125096f, 0.253424f, 0.278331f, 1f) }, { "40809F", new Color(0.1253f, 0.253584f, 0.346636f, 1f) }, { "4080BF", new Color(0.125665f, 0.254283f, 0.419336f, 1f) }, { "4080DF", new Color(0.127883f, 0.254989f, 0.489387f, 1f) }, { "4080FF", new Color(0.124316f, 0.256579f, 0.569056f, 1f) }, { "409F00", new Color(0.124857f, 0.318204f, 0f, 1f) }, { "409F20", new Color(0.124041f, 0.317211f, 0.069796f, 1f) }, { "409F40", new Color(0.124842f, 0.319966f, 0.141552f, 1f) }, { "409F60", new Color(0.125232f, 0.319716f, 0.209081f, 1f) }, { "409F80", new Color(0.124487f, 0.318401f, 0.27902f, 1f) }, { "409F9F", new Color(0.124535f, 0.317909f, 0.348352f, 1f) }, { "409FBF", new Color(0.125443f, 0.319197f, 0.419268f, 1f) }, { "409FDF", new Color(0.125946f, 0.320179f, 0.486533f, 1f) }, { "409FFF", new Color(0.127266f, 0.322126f, 0.562297f, 1f) }, { "40BF00", new Color(0.130671f, 0.387965f, 0f, 1f) }, { "40BF20", new Color(0.128129f, 0.386423f, 0.068521f, 1f) }, { "40BF40", new Color(0.130621f, 0.387615f, 0.138531f, 1f) }, { "40BF60", new Color(0.128407f, 0.387928f, 0.207571f, 1f) }, { "40BF80", new Color(0.125936f, 0.382843f, 0.278875f, 1f) }, { "40BF9F", new Color(0.129943f, 0.38843f, 0.346215f, 1f) }, { "40BFBF", new Color(0.128241f, 0.38724f, 0.416389f, 1f) }, { "40BFDF", new Color(0.128169f, 0.387539f, 0.487342f, 1f) }, { "40BFFF", new Color(0.127815f, 0.385771f, 0.564059f, 1f) }, { "40DF00", new Color(0.124565f, 0.449325f, 0f, 1f) }, { "40DF20", new Color(0.127868f, 0.451855f, 0.068467f, 1f) }, { "40DF40", new Color(0.128452f, 0.452575f, 0.142333f, 1f) }, { "40DF60", new Color(0.127771f, 0.450988f, 0.207956f, 1f) }, { "40DF80", new Color(0.130467f, 0.452771f, 0.277768f, 1f) }, { "40DF9F", new Color(0.124122f, 0.445434f, 0.346217f, 1f) }, { "40DFBF", new Color(0.125818f, 0.450016f, 0.41838f, 1f) }, { "40DFDF", new Color(0.130753f, 0.444971f, 0.485265f, 1f) }, { "40DFFF", new Color(0.130539f, 0.450712f, 0.566446f, 1f) }, { "40FF00", new Color(0.125343f, 0.530784f, 0f, 1f) }, { "40FF20", new Color(0.125884f, 0.520698f, 0.067895f, 1f) }, { "40FF40", new Color(0.126118f, 0.523734f, 0.141577f, 1f) }, { "40FF60", new Color(0.123756f, 0.523771f, 0.207847f, 1f) }, { "40FF80", new Color(0.125759f, 0.523498f, 0.277863f, 1f) }, { "40FF9F", new Color(0.125307f, 0.523287f, 0.346738f, 1f) }, { "40FFBF", new Color(0.124471f, 0.528062f, 0.416438f, 1f) }, { "40FFDF", new Color(0.123536f, 0.523616f, 0.486724f, 1f) }, { "40FFFF", new Color(0.125884f, 0.523851f, 0.566386f, 1f) }, { "600000", new Color(0.190665f, 0f, 0f, 1f) }, { "600020", new Color(207f / (335f * (float)Math.PI), 0f, 0.071063f, 1f) }, { "600040", new Color(0.197955f, 0f, 0.14117f, 1f) }, { "600060", new Color(0.194847f, 0f, 0.207552f, 1f) }, { "600080", new Color(0.19619f, 0f, 0.277614f, 1f) }, { "60009F", new Color(0.194923f, 0f, 0.349743f, 1f) }, { "6000BF", new Color(0.196656f, 0f, 0.414856f, 1f) }, { "6000DF", new Color(0.195661f, 0f, 0.485595f, 1f) }, { "6000FF", new Color(0.195723f, 0f, 0.563345f, 1f) }, { "602000", new Color(0.196104f, 0.068495f, 0f, 1f) }, { "602020", new Color(0.194844f, 0.066434f, 0.068439f, 1f) }, { "602040", new Color(0.195119f, 0.06559f, 0.138618f, 1f) }, { "602060", new Color(0.194229f, 0.064731f, 0.207598f, 1f) }, { "602080", new Color(0.194938f, 0.063904f, 0.279419f, 1f) }, { "60209F", new Color(0.191812f, 0.068433f, 0.347084f, 1f) }, { "6020BF", new Color(0.194392f, 0.065574f, 0.417061f, 1f) }, { "6020DF", new Color(0.195095f, 0.065145f, 0.486348f, 1f) }, { "6020FF", new Color(0.19696f, 0.066442f, 0.563492f, 1f) }, { "604000", new Color(0.191862f, 0.124564f, 0f, 1f) }, { "604020", new Color(0.193647f, 0.127689f, 0.067894f, 1f) }, { "604040", new Color(0.194093f, 0.127403f, 0.142393f, 1f) }, { "604060", new Color(0.194508f, 0.124837f, 0.209001f, 1f) }, { "604080", new Color(0.196203f, 0.127955f, 0.279081f, 1f) }, { "60409F", new Color(0.194649f, 0.127404f, 0.345447f, 1f) }, { "6040BF", new Color(0.194013f, 0.127329f, 0.417406f, 1f) }, { "6040DF", new Color(0.19034f, 0.124958f, 0.486682f, 1f) }, { "6040FF", new Color(0.196706f, 0.129391f, 0.563341f, 1f) }, { "606000", new Color(0.195007f, 0.194969f, 0f, 1f) }, { "606020", new Color(0.194031f, 0.193237f, 0.068243f, 1f) }, { "606040", new Color(0.194473f, 0.19301f, 0.138773f, 1f) }, { "606060", new Color(0.19679f, 0.194121f, 0.20961f, 1f) }, { "606080", new Color(0.195492f, 0.193199f, 0.27943f, 1f) }, { "60609F", new Color(0.195416f, 0.193717f, 0.349793f, 1f) }, { "6060BF", new Color(0.194791f, 0.193673f, 0.41658f, 1f) }, { "6060DF", new Color(0.19496f, 0.193442f, 0.485109f, 1f) }, { "6060FF", new Color(0.196799f, 0.195442f, 0.564077f, 1f) }, { "608000", new Color(0.195651f, 0.260161f, 0f, 1f) }, { "608020", new Color(0.194615f, 0.257915f, 0.068441f, 1f) }, { "608040", new Color(0.194777f, 0.257387f, 0.138073f, 1f) }, { "608060", new Color(0.195085f, 0.257142f, 0.208069f, 1f) }, { "608080", new Color(0.190467f, 0.253319f, 0.279237f, 1f) }, { "60809F", new Color(0.196869f, 0.257401f, 0.349818f, 1f) }, { "6080BF", new Color(0.195581f, 0.257674f, 0.418046f, 1f) }, { "6080DF", new Color(0.195752f, 0.257845f, 0.489204f, 1f) }, { "6080FF", new Color(0.196432f, 0.259658f, 0.565742f, 1f) }, { "609F00", new Color(0.192016f, 0.31844f, 0f, 1f) }, { "609F20", new Color(0.194272f, 0.321666f, 0.067945f, 1f) }, { "609F40", new Color(0.194909f, 0.322411f, 0.137971f, 1f) }, { "609F60", new Color(0.194642f, 0.32237f, 0.207641f, 1f) }, { "609F80", new Color(0.193849f, 0.320934f, 0.280204f, 1f) }, { "609F9F", new Color(0.194674f, 0.321011f, 0.346044f, 1f) }, { "609FBF", new Color(0.195518f, 0.322231f, 0.417561f, 1f) }, { "609FDF", new Color(0.195817f, 0.323221f, 0.489301f, 1f) }, { "609FFF", new Color(0.191154f, 0.317917f, 0.563917f, 1f) }, { "60BF00", new Color(0.192475f, 0.385841f, 0f, 1f) }, { "60BF20", new Color(0.194249f, 0.387577f, 0.067589f, 1f) }, { "60BF40", new Color(0.195075f, 0.383392f, 0.142225f, 1f) }, { "60BF60", new Color(0.194824f, 0.387966f, 0.207567f, 1f) }, { "60BF80", new Color(0.19547f, 0.388322f, 0.279305f, 1f) }, { "60BF9F", new Color(0.196804f, 0.383243f, 0.350202f, 1f) }, { "60BFBF", new Color(0.195005f, 0.388023f, 0.417499f, 1f) }, { "60BFDF", new Color(0.19629f, 0.38382f, 0.484284f, 1f) }, { "60BFFF", new Color(0.1959f, 0.384878f, 0.566612f, 1f) }, { "60DF00", new Color(0.195904f, 0.452507f, 0f, 1f) }, { "60DF20", new Color(0.194336f, 0.448863f, 0.067577f, 1f) }, { "60DF40", new Color(0.194938f, 0.448447f, 0.138301f, 1f) }, { "60DF60", new Color(0.195018f, 0.448562f, 0.207446f, 1f) }, { "60DF80", new Color(0.196043f, 0.447894f, 0.279366f, 1f) }, { "60DF9F", new Color(0.194922f, 0.452693f, 0.349347f, 1f) }, { "60DFBF", new Color(0.193842f, 0.448414f, 0.416802f, 1f) }, { "60DFDF", new Color(0.195144f, 0.452188f, 0.48812f, 1f) }, { "60DFFF", new Color(0.196638f, 0.451826f, 0.56329f, 1f) }, { "60FF00", new Color(0.194483f, 0.529432f, 0f, 1f) }, { "60FF20", new Color(0.194739f, 0.525579f, 0.068479f, 1f) }, { "60FF40", new Color(0.194856f, 0.523826f, 0.138471f, 1f) }, { "60FF60", new Color(0.194922f, 0.523693f, 0.208257f, 1f) }, { "60FF80", new Color(0.195443f, 0.523845f, 0.279559f, 1f) }, { "60FF9F", new Color(0.194654f, 0.52427f, 0.350084f, 1f) }, { "60FFBF", new Color(0.193648f, 0.52506f, 0.416142f, 1f) }, { "60FFDF", new Color(0.194424f, 0.524636f, 0.48762f, 1f) }, { "60FFFF", new Color(0.194169f, 0.524212f, 0.565992f, 1f) }, { "800000", new Color(0.254794f, 0f, 0f, 1f) }, { "800020", new Color(0.25915f, 0f, 0.068718f, 1f) }, { "800040", new Color(0.260676f, 0f, 0.140795f, 1f) }, { "800060", new Color(0.25276f, 0f, 0.209183f, 1f) }, { "800080", new Color(0.256163f, 0f, 0.276212f, 1f) }, { "80009F", new Color(0.253017f, 0f, 0.34556f, 1f) }, { "8000BF", new Color(0.260329f, 0f, 0.41976f, 1f) }, { "8000DF", new Color(0.253012f, 0f, 0.487071f, 1f) }, { "8000FF", new Color(0.260707f, 0f, 0.570361f, 1f) }, { "802000", new Color(0.253891f, 0.065099f, 0f, 1f) }, { "802020", new Color(0.259795f, 0.066085f, 0.06781f, 1f) }, { "802040", new Color(0.253338f, 0.062595f, 0.140714f, 1f) }, { "802060", new Color(0.259062f, 0.064755f, 0.207962f, 1f) }, { "802080", new Color(0.257047f, 0.061232f, 0.278493f, 1f) }, { "80209F", new Color(0.259306f, 0.065083f, 0.349649f, 1f) }, { "8020BF", new Color(0.260607f, 0.065767f, 0.417385f, 1f) }, { "8020DF", new Color(0.260354f, 0.065343f, 0.488916f, 1f) }, { "8020FF", new Color(0.254536f, 0.063841f, 0.563479f, 1f) }, { "804000", new Color(0.253863f, 0.129077f, 0f, 1f) }, { "804020", new Color(0.259364f, 0.128203f, 0.067566f, 1f) }, { "804040", new Color(0.260023f, 0.127455f, 0.138122f, 1f) }, { "804060", new Color(0.253144f, 0.126966f, 0.210067f, 1f) }, { "804080", new Color(0.257655f, 0.125232f, 0.279494f, 1f) }, { "80409F", new Color(0.253105f, 0.127304f, 0.350187f, 1f) }, { "8040BF", new Color(0.259967f, 0.127626f, 0.417492f, 1f) }, { "8040DF", new Color(0.260588f, 0.127537f, 0.488564f, 1f) }, { "8040FF", new Color(0.253775f, 0.127846f, 0.566745f, 1f) }, { "806000", new Color(0.254511f, 0.191474f, 0f, 1f) }, { "806020", new Color(0.260041f, 0.193444f, 0.068434f, 1f) }, { "806040", new Color(0.253014f, 0.19394f, 0.141013f, 1f) }, { "806060", new Color(0.259817f, 0.193585f, 0.208361f, 1f) }, { "806080", new Color(0.253207f, 0.195317f, 0.278034f, 1f) }, { "80609F", new Color(0.259671f, 0.193721f, 0.345825f, 1f) }, { "8060BF", new Color(0.252944f, 0.194025f, 0.417655f, 1f) }, { "8060DF", new Color(0.260089f, 0.193648f, 0.48796f, 1f) }, { "8060FF", new Color(0.253627f, 0.190208f, 0.567725f, 1f) }, { "808000", new Color(0.254865f, 0.257509f, 0f, 1f) }, { "808020", new Color(0.260295f, 0.258321f, 0.067264f, 1f) }, { "808040", new Color(0.260561f, 0.258436f, 0.142302f, 1f) }, { "808060", new Color(0.253168f, 0.253733f, 0.210392f, 1f) }, { "808080", new Color(0.258873f, 0.257158f, 0.279532f, 1f) }, { "80809F", new Color(0.253198f, 0.253574f, 0.349406f, 1f) }, { "8080BF", new Color(0.259748f, 0.257824f, 0.417923f, 1f) }, { "8080DF", new Color(0.253184f, 0.2549f, 0.485186f, 1f) }, { "8080FF", new Color(0.260199f, 0.258374f, 0.563998f, 1f) }, { "809F00", new Color(0.254546f, 0.318987f, 0f, 1f) }, { "809F20", new Color(0.260271f, 0.322711f, 0.067652f, 1f) }, { "809F40", new Color(0.256053f, 0.323271f, 0.138071f, 1f) }, { "809F60", new Color(0.26015f, 0.323375f, 0.207825f, 1f) }, { "809F80", new Color(0.260281f, 0.322159f, 0.280416f, 1f) }, { "809F9F", new Color(0.253119f, 0.318807f, 0.345616f, 1f) }, { "809FBF", new Color(0.259799f, 0.322597f, 0.41732f, 1f) }, { "809FDF", new Color(0.260617f, 0.322736f, 0.483917f, 1f) }, { "809FFF", new Color(0.253725f, 0.317392f, 0.567027f, 1f) }, { "80BF00", new Color(0.256973f, 0.385981f, 0f, 1f) }, { "80BF20", new Color(0.260157f, 0.38801f, 0.067264f, 1f) }, { "80BF40", new Color(0.253099f, 0.386762f, 0.138795f, 1f) }, { "80BF60", new Color(0.260202f, 0.383218f, 0.207356f, 1f) }, { "80BF80", new Color(0.253715f, 0.382859f, 0.278598f, 1f) }, { "80BF9F", new Color(0.259776f, 0.387213f, 0.349662f, 1f) }, { "80BFBF", new Color(0.253219f, 0.383416f, 0.419044f, 1f) }, { "80BFDF", new Color(0.260272f, 0.387484f, 0.483505f, 1f) }, { "80BFFF", new Color(0.253328f, 0.385948f, 0.566866f, 1f) }, { "80DF00", new Color(0.255947f, 0.445423f, 0f, 1f) }, { "80DF20", new Color(0.260562f, 0.447962f, 0.071644f, 1f) }, { "80DF40", new Color(0.255196f, 0.45275f, 0.137006f, 1f) }, { "80DF60", new Color(0.255447f, 0.452813f, 0.209743f, 1f) }, { "80DF80", new Color(0.257645f, 0.445206f, 0.277074f, 1f) }, { "80DF9F", new Color(0.258537f, 0.444966f, 0.346146f, 1f) }, { "80DFBF", new Color(0.257677f, 0.444952f, 0.415924f, 1f) }, { "80DFDF", new Color(0.260611f, 0.448106f, 0.488026f, 1f) }, { "80DFFF", new Color(0.253138f, 0.450249f, 0.567927f, 1f) }, { "80FF00", new Color(0.258976f, 0.528462f, 0f, 1f) }, { "80FF20", new Color(0.253006f, 0.525368f, 0.071255f, 1f) }, { "80FF40", new Color(0.259535f, 0.524826f, 0.138716f, 1f) }, { "80FF60", new Color(0.260671f, 0.524388f, 0.20838f, 1f) }, { "80FF80", new Color(0.253049f, 0.52381f, 0.27931f, 1f) }, { "80FF9F", new Color(0.260069f, 0.523554f, 0.350408f, 1f) }, { "80FFBF", new Color(0.253198f, 0.524071f, 0.415169f, 1f) }, { "80FFDF", new Color(0.259528f, 0.524235f, 0.488563f, 1f) }, { "80FFFF", new Color(0.259246f, 0.524401f, 0.566897f, 1f) }, { "9F0000", new Color(0.315984f, 0f, 0f, 1f) }, { "9F0020", new Color(0.322817f, 0f, 0.0711f, 1f) }, { "9F0040", new Color(0.318484f, 0f, 0.139136f, 1f) }, { "9F0060", new Color(0.316321f, 0f, 0.206536f, 1f) }, { "9F0080", new Color(0.316188f, 0f, 0.280627f, 1f) }, { "9F009F", new Color(0.316742f, 0f, 0.34582f, 1f) }, { "9F00BF", new Color(0.318456f, 0f, 0.418105f, 1f) }, { "9F00DF", new Color(0.317375f, 0f, 0.486755f, 1f) }, { "9F00FF", new Color(51f / 160f, 0f, 0.570238f, 1f) }, { "9F2000", new Color(0.31982f, 0.064702f, 0f, 1f) }, { "9F2020", new Color(0.318638f, 0.062174f, 0.071265f, 1f) }, { "9F2040", new Color(0.318122f, 0.06723f, 0.141354f, 1f) }, { "9F2060", new Color(0.316607f, 0.061714f, 0.208776f, 1f) }, { "9F2080", new Color(0.317353f, 0.061565f, 0.275314f, 1f) }, { "9F209F", new Color(0.322784f, 0.068623f, 0.346325f, 1f) }, { "9F20BF", new Color(0.319857f, 0.062853f, 0.414297f, 1f) }, { "9F20DF", new Color(0.31817f, 0.062026f, 0.48418f, 1f) }, { "9F20FF", new Color(0.317896f, 0.062883f, 0.563426f, 1f) }, { "9F4000", new Color(0.320492f, 0.128963f, 0f, 1f) }, { "9F4020", new Color(0.318809f, 0.126183f, 0.071153f, 1f) }, { "9F4040", new Color(0.323415f, 0.12768f, 0.138906f, 1f) }, { "9F4060", new Color(0.318089f, 0.131169f, 0.209018f, 1f) }, { "9F4080", new Color(0.31758f, 0.123693f, 0.275364f, 1f) }, { "9F409F", new Color(0.318093f, 0.125467f, 0.347922f, 1f) }, { "9F40BF", new Color(0.318103f, 0.12525f, 0.418692f, 1f) }, { "9F40DF", new Color(0.318532f, 0.125267f, 0.484038f, 1f) }, { "9F40FF", new Color(0.317577f, 0.12605f, 0.567285f, 1f) }, { "9F6000", new Color(0.320941f, 0.196192f, 0f, 1f) }, { "9F6020", new Color(0.318857f, 0.194399f, 0.071565f, 1f) }, { "9F6040", new Color(0.323303f, 0.196389f, 0.138863f, 1f) }, { "9F6060", new Color(0.317648f, 0.190713f, 0.210346f, 1f) }, { "9F6080", new Color(0.323157f, 0.192846f, 0.279612f, 1f) }, { "9F609F", new Color(0.317751f, 0.1935f, 0.348468f, 1f) }, { "9F60BF", new Color(0.317589f, 0.194056f, 0.419191f, 1f) }, { "9F60DF", new Color(0.323513f, 0.192474f, 0.483597f, 1f) }, { "9F60FF", new Color(0.319067f, 0.193702f, 0.564352f, 1f) }, { "9F8000", new Color(0.321278f, 0.258109f, 0f, 1f) }, { "9F8020", new Color(0.319532f, 0.255768f, 0.071706f, 1f) }, { "9F8040", new Color(0.319031f, 0.255459f, 0.136322f, 1f) }, { "9F8060", new Color(0.318554f, 0.254047f, 0.208956f, 1f) }, { "9F8080", new Color(0.31817f, 0.253641f, 0.279441f, 1f) }, { "9F809F", new Color(0.317671f, 0.253522f, 0.348195f, 1f) }, { "9F80BF", new Color(0.323439f, 0.257231f, 0.417629f, 1f) }, { "9F80DF", new Color(0.319901f, 0.254283f, 0.488513f, 1f) }, { "9F80FF", new Color(0.31922f, 0.254899f, 0.567642f, 1f) }, { "9F9F00", new Color(0.315968f, 0.319071f, 0f, 1f) }, { "9F9F20", new Color(0.318662f, 0.322038f, 0.070914f, 1f) }, { "9F9F40", new Color(0.318413f, 0.316873f, 0.13968f, 1f) }, { "9F9F60", new Color(0.318571f, 0.320492f, 0.2086f, 1f) }, { "9F9F80", new Color(0.317554f, 0.318117f, 0.278792f, 1f) }, { "9F9F9F", new Color(0.323357f, 0.321145f, 0.349915f, 1f) }, { "9F9FBF", new Color(0.319956f, 0.321537f, 0.414382f, 1f) }, { "9F9FDF", new Color(0.318899f, 0.321235f, 0.483707f, 1f) }, { "9F9FFF", new Color(0.318466f, 0.321916f, 0.563937f, 1f) }, { "9FBF00", new Color(0.320477f, 0.385131f, 0f, 1f) }, { "9FBF20", new Color(0.318502f, 0.383477f, 0.071156f, 1f) }, { "9FBF40", new Color(0.322952f, 0.387511f, 0.142624f, 1f) }, { "9FBF60", new Color(0.318458f, 0.382515f, 0.209163f, 1f) }, { "9FBF80", new Color(0.317708f, 0.38671f, 0.278475f, 1f) }, { "9FBF9F", new Color(0.323218f, 0.388764f, 0.346387f, 1f) }, { "9FBFBF", new Color(0.318768f, 0.383248f, 0.418159f, 1f) }, { "9FBFDF", new Color(0.318117f, 0.382941f, 0.488598f, 1f) }, { "9FBFFF", new Color(0.323369f, 0.385402f, 0.563826f, 1f) }, { "9FDF00", new Color(0.321296f, 0.448118f, 0f, 1f) }, { "9FDF20", new Color(0.32264f, 0.444447f, 0.071259f, 1f) }, { "9FDF40", new Color(0.318783f, 0.450902f, 0.141857f, 1f) }, { "9FDF60", new Color(0.318343f, 0.451374f, 0.20885f, 1f) }, { "9FDF80", new Color(0.321766f, 0.445151f, 0.276524f, 1f) }, { "9FDF9F", new Color(0.320028f, 0.449667f, 0.346917f, 1f) }, { "9FDFBF", new Color(0.317665f, 0.448937f, 0.419036f, 1f) }, { "9FDFDF", new Color(0.322371f, 0.445517f, 0.487649f, 1f) }, { "9FDFFF", new Color(0.319469f, 0.449009f, 0.564452f, 1f) }, { "9FFF00", new Color(0.317566f, 0.532915f, 0f, 1f) }, { "9FFF20", new Color(0.318242f, 0.525396f, 0.068374f, 1f) }, { "9FFF40", new Color(0.318226f, 0.525287f, 0.141674f, 1f) }, { "9FFF60", new Color(0.318282f, 0.525527f, 0.209792f, 1f) }, { "9FFF80", new Color(0.318391f, 0.524104f, 0.279447f, 1f) }, { "9FFF9F", new Color(0.31827f, 0.524134f, 0.348777f, 1f) }, { "9FFFBF", new Color(0.317598f, 0.52406f, 0.418512f, 1f) }, { "9FFFDF", new Color(0.318716f, 0.524011f, 0.489827f, 1f) }, { "9FFFFF", new Color(0.318258f, 0.523889f, 0.567267f, 1f) }, { "BF0000", new Color(0.388655f, 0f, 0f, 1f) }, { "BF0020", new Color(0.388645f, 0f, 0.071367f, 1f) }, { "BF0040", new Color(0.387882f, 0f, 0.141718f, 1f) }, { "BF0060", new Color(0.383219f, 0f, 0.206543f, 1f) }, { "BF0080", new Color(0.389385f, 0f, 0.279845f, 1f) }, { "BF009F", new Color(0.384331f, 0f, 0.34447f, 1f) }, { "BF00BF", new Color(0.38333f, 0f, 0.41882f, 1f) }, { "BF00DF", new Color(0.389562f, 0f, 0.485944f, 1f) }, { "BF00FF", new Color(0.389821f, 0f, 0.56951f, 1f) }, { "BF2000", new Color(0.383287f, 0.063532f, 0f, 1f) }, { "BF2020", new Color(0.387994f, 0.063391f, 0.071181f, 1f) }, { "BF2040", new Color(0.386848f, 0.067815f, 0.138669f, 1f) }, { "BF2060", new Color(0.38895f, 0.065525f, 0.207555f, 1f) }, { "BF2080", new Color(0.388432f, 0.068462f, 0.277953f, 1f) }, { "BF209F", new Color(0.388679f, 0.064493f, 0.345474f, 1f) }, { "BF20BF", new Color(0.389691f, 0.063873f, 0.415925f, 1f) }, { "BF20DF", new Color(0.388565f, 0.0632f, 0.487904f, 1f) }, { "BF20FF", new Color(0.389259f, 0.063728f, 0.564668f, 1f) }, { "BF4000", new Color(0.386262f, 0.130356f, 0f, 1f) }, { "BF4020", new Color(0.388492f, 0.129403f, 0.070406f, 1f) }, { "BF4040", new Color(0.388987f, 0.130936f, 0.139057f, 1f) }, { "BF4060", new Color(0.389386f, 0.130857f, 0.209068f, 1f) }, { "BF4080", new Color(0.389068f, 0.129891f, 0.277791f, 1f) }, { "BF409F", new Color(0.385918f, 0.127799f, 0.349269f, 1f) }, { "BF40BF", new Color(0.388482f, 0.128232f, 0.419369f, 1f) }, { "BF40DF", new Color(0.389034f, 0.127644f, 0.484013f, 1f) }, { "BF40FF", new Color(0.387719f, 0.125224f, 0.567234f, 1f) }, { "BF6000", new Color(0.383931f, 0.192046f, 0f, 1f) }, { "BF6020", new Color(0.388325f, 0.195667f, 0.070769f, 1f) }, { "BF6040", new Color(0.386769f, 0.195256f, 0.13913f, 1f) }, { "BF6060", new Color(0.386268f, 0.194803f, 0.208812f, 1f) }, { "BF6080", new Color(0.385216f, 0.195519f, 0.278365f, 1f) }, { "BF609F", new Color(0.388089f, 0.195341f, 0.347389f, 1f) }, { "BF60BF", new Color(0.388931f, 0.194281f, 0.414915f, 1f) }, { "BF60DF", new Color(0.384535f, 0.193391f, 0.488156f, 1f) }, { "BF60FF", new Color(0.385336f, 0.195612f, 0.567398f, 1f) }, { "BF8000", new Color(0.382644f, 0.257344f, 0f, 1f) }, { "BF8020", new Color(0.389804f, 0.258265f, 0.068042f, 1f) }, { "BF8040", new Color(0.389426f, 0.257198f, 0.137177f, 1f) }, { "BF8060", new Color(0.388178f, 0.25663f, 0.208914f, 1f) }, { "BF8080", new Color(0.388356f, 0.256132f, 0.279023f, 1f) }, { "BF809F", new Color(0.389094f, 0.256213f, 0.346088f, 1f) }, { "BF80BF", new Color(0.38624f, 0.257546f, 0.416675f, 1f) }, { "BF80DF", new Color(0.38848f, 0.256327f, 0.484552f, 1f) }, { "BF80FF", new Color(0.389019f, 0.257817f, 0.567858f, 1f) }, { "BF9F00", new Color(0.389713f, 0.3228f, 0f, 1f) }, { "BF9F20", new Color(0.389107f, 0.320707f, 0.069582f, 1f) }, { "BF9F40", new Color(0.386253f, 0.322012f, 0.142522f, 1f) }, { "BF9F60", new Color(0.388483f, 0.319258f, 0.210157f, 1f) }, { "BF9F80", new Color(0.389536f, 0.318588f, 0.279135f, 1f) }, { "BF9F9F", new Color(0.386694f, 0.321255f, 0.350177f, 1f) }, { "BF9FBF", new Color(0.389182f, 0.320113f, 0.414976f, 1f) }, { "BF9FDF", new Color(0.38937f, 0.319558f, 0.483699f, 1f) }, { "BF9FFF", new Color(0.386807f, 0.323383f, 0.567051f, 1f) }, { "BFBF00", new Color(0.383768f, 0.384754f, 0f, 1f) }, { "BFBF20", new Color(0.388652f, 0.388145f, 0.071049f, 1f) }, { "BFBF40", new Color(0.388376f, 0.383282f, 0.1399f, 1f) }, { "BFBF60", new Color(0.388352f, 0.388165f, 0.209651f, 1f) }, { "BFBF80", new Color(0.385923f, 0.387271f, 0.279886f, 1f) }, { "BFBF9F", new Color(0.389439f, 0.383974f, 0.346782f, 1f) }, { "BFBFBF", new Color(0.389096f, 0.388017f, 0.414764f, 1f) }, { "BFBFDF", new Color(0.386064f, 0.386699f, 0.487633f, 1f) }, { "BFBFFF", new Color(0.386054f, 0.385477f, 0.567237f, 1f) }, { "BFDF00", new Color(0.38654f, 0.451071f, 0f, 1f) }, { "BFDF20", new Color(0.388781f, 0.446634f, 0.070784f, 1f) }, { "BFDF40", new Color(0.384232f, 0.44483f, 0.141251f, 1f) }, { "BFDF60", new Color(0.384525f, 0.445292f, 0.209993f, 1f) }, { "BFDF80", new Color(0.388794f, 0.447059f, 0.278573f, 1f) }, { "BFDF9F", new Color(0.386068f, 0.452723f, 0.349725f, 1f) }, { "BFDFBF", new Color(0.388654f, 0.448465f, 0.415976f, 1f) }, { "BFDFDF", new Color(0.389212f, 0.447482f, 0.485303f, 1f) }, { "BFDFFF", new Color(0.386134f, 0.451369f, 0.56754f, 1f) }, { "BFFF00", new Color(0.388282f, 0.52833f, 0f, 1f) }, { "BFFF20", new Color(0.388397f, 0.524565f, 0.071011f, 1f) }, { "BFFF40", new Color(0.382433f, 0.523299f, 0.137385f, 1f) }, { "BFFF60", new Color(0.388907f, 0.523503f, 0.209027f, 1f) }, { "BFFF80", new Color(0.389131f, 0.524003f, 0.279095f, 1f) }, { "BFFF9F", new Color(0.389164f, 0.525088f, 0.346877f, 1f) }, { "BFFFBF", new Color(0.388899f, 0.524444f, 0.414785f, 1f) }, { "BFFFDF", new Color(0.389585f, 0.523946f, (float)Math.E * 47f / 261f, 1f) }, { "BFFFFF", new Color(0.388565f, 0.523918f, 0.567135f, 1f) }, { "DF0000", new Color(0.445572f, 0f, 0f, 1f) }, { "DF0020", new Color(0.447334f, 0f, 0.070279f, 1f) }, { "DF0040", new Color(0.451134f, 0f, 0.139114f, 1f) }, { "DF0060", new Color(0.451562f, 0f, 0.207917f, 1f) }, { "DF0080", new Color(0.445235f, 0f, 0.277641f, 1f) }, { "DF009F", new Color(0.449116f, 0f, 0.346669f, 1f) }, { "DF00BF", new Color(0.448847f, 0f, 0.416563f, 1f) }, { "DF00DF", new Color(0.448524f, 0f, 0.485177f, 1f) }, { "DF00FF", new Color(0.44799f, 0f, 0.57125f, 1f) }, { "DF2000", new Color(0.447095f, 0.063101f, 0f, 1f) }, { "DF2020", new Color(0.448999f, 0.06763f, 0.067307f, 1f) }, { "DF2040", new Color(0.451242f, 0.065974f, 0.142361f, 1f) }, { "DF2060", new Color(0.451531f, 0.065667f, 0.207525f, 1f) }, { "DF2080", new Color(0.451613f, 0.065297f, 0.279036f, 1f) }, { "DF209F", new Color(0.449519f, 0.061623f, 0.347117f, 1f) }, { "DF20BF", new Color(0.449009f, 0.066639f, 0.418286f, 1f) }, { "DF20DF", new Color(0.448232f, 0.068559f, 0.489105f, 1f) }, { "DF20FF", new Color(0.452384f, 0.065539f, 0.564608f, 1f) }, { "DF4000", new Color(0.452874f, 0.130864f, 0f, 1f) }, { "DF4020", new Color(0.45155f, 0.129479f, 0.06839f, 1f) }, { "DF4040", new Color(0.452283f, 0.129956f, 0.138655f, 1f) }, { "DF4060", new Color(0.445699f, 0.127598f, 0.208285f, 1f) }, { "DF4080", new Color(0.449703f, 0.126972f, 0.279043f, 1f) }, { "DF409F", new Color(0.447334f, 0.123929f, 0.346971f, 1f) }, { "DF40BF", new Color(0.449354f, 0.130802f, 0.418007f, 1f) }, { "DF40DF", new Color(0.447633f, 0.124599f, 0.488106f, 1f) }, { "DF40FF", new Color(0.452372f, 0.12856f, 0.563499f, 1f) }, { "DF6000", new Color(0.446837f, 0.191853f, 0f, 1f) }, { "DF6020", new Color(0.451469f, 0.194501f, 0.068195f, 1f) }, { "DF6040", new Color(0.45196f, 0.195085f, 0.13807f, 1f) }, { "DF6060", new Color(0.447576f, 0.19588f, 0.209904f, 1f) }, { "DF6080", new Color(0.45229f, 0.195494f, 0.278709f, 1f) }, { "DF609F", new Color(0.451374f, 0.193939f, 0.349937f, 1f) }, { "DF60BF", new Color(0.451447f, 0.193172f, 0.41646f, 1f) }, { "DF60DF", new Color(0.446467f, 0.194456f, 0.484367f, 1f) }, { "DF60FF", new Color(0.451652f, 0.194705f, 0.567404f, 1f) }, { "DF8000", new Color(0.445976f, 0.2572f, 0f, 1f) }, { "DF8020", new Color(0.451284f, 0.258409f, 0.0673f, 1f) }, { "DF8040", new Color(0.452264f, 0.259065f, 0.142035f, 1f) }, { "DF8060", new Color(0.451908f, 0.258919f, 0.208416f, 1f) }, { "DF8080", new Color(0.452491f, 0.2586f, 0.280006f, 1f) }, { "DF809F", new Color(0.446066f, 0.25472f, 0.34801f, 1f) }, { "DF80BF", new Color(0.4496f, 0.253924f, 0.418229f, 1f) }, { "DF80DF", new Color(0.451379f, 0.257166f, 0.488357f, 1f) }, { "DF80FF", new Color(0.452766f, 0.259773f, 0.563825f, 1f) }, { "DF9F00", new Color(0.446524f, 0.319098f, 0f, 1f) }, { "DF9F20", new Color(0.451763f, 0.323077f, 0.067953f, 1f) }, { "DF9F40", new Color(0.450912f, 0.316605f, 0.141469f, 1f) }, { "DF9F60", new Color(0.445673f, 0.321242f, 0.209672f, 1f) }, { "DF9F80", new Color(0.447601f, 0.318535f, 0.278757f, 1f) }, { "DF9F9F", new Color(0.451292f, 0.321119f, 0.345576f, 1f) }, { "DF9FBF", new Color(0.452078f, 0.321679f, 0.416171f, 1f) }, { "DF9FDF", new Color(0.445915f, 0.321042f, 0.484034f, 1f) }, { "DF9FFF", new Color(0.451347f, 0.317763f, 0.567382f, 1f) }, { "DFBF00", new Color(0.445733f, 0.385092f, 0f, 1f) }, { "DFBF20", new Color(0.448929f, 0.382417f, 0.071665f, 1f) }, { "DFBF40", new Color(0.451496f, 0.386104f, 0.139019f, 1f) }, { "DFBF60", new Color(0.451294f, 0.387285f, 0.207897f, 1f) }, { "DFBF80", new Color(0.451207f, 0.387719f, 0.279623f, 1f) }, { "DFBF9F", new Color(0.452275f, 0.388302f, 0.349716f, 1f) }, { "DFBFBF", new Color(0.452598f, 0.388353f, 0.416156f, 1f) }, { "DFBFDF", new Color(0.451551f, 0.387881f, 0.488242f, 1f) }, { "DFBFFF", new Color(0.452212f, 0.38573f, 0.563671f, 1f) }, { "DFDF00", new Color(0.452826f, 0.451198f, 0f, 1f) }, { "DFDF20", new Color(0.451417f, 0.45261f, 0.067806f, 1f) }, { "DFDF40", new Color(0.451118f, 0.452346f, 0.142108f, 1f) }, { "DFDF60", new Color(0.449988f, 0.445046f, 0.207155f, 1f) }, { "DFDF80", new Color(0.450869f, 0.445144f, 0.276977f, 1f) }, { "DFDF9F", new Color(0.445855f, 0.451634f, 0.34834f, 1f) }, { "DFDFBF", new Color(0.452053f, 0.449277f, 0.416543f, 1f) }, { "DFDFDF", new Color(0.45292f, 0.448222f, 0.484024f, 1f) }, { "DFDFFF", new Color(0.446783f, 0.449836f, 0.567466f, 1f) }, { "DFFF00", new Color(0.448959f, 0.528979f, 0f, 1f) }, { "DFFF20", new Color((float)Math.E * 14f / 85f, 0.520361f, 0.069698f, 1f) }, { "DFFF40", new Color(0.449194f, 0.523783f, 0.141411f, 1f) }, { "DFFF60", new Color(0.451564f, 0.523033f, 0.208759f, 1f) }, { "DFFF80", new Color(0.452695f, 0.523451f, 0.279229f, 1f) }, { "DFFF9F", new Color(0.452516f, 0.524811f, 0.349856f, 1f) }, { "DFFFBF", new Color(0.446115f, 0.524355f, 0.417641f, 1f) }, { "DFFFDF", new Color(0.452343f, 0.523912f, 0.488543f, 1f) }, { "DFFFFF", new Color(0.447887f, 0.528246f, 0.566981f, 1f) }, { "FF0000", new Color(0.550077f, 0f, 0f, 1f) }, { "FF0020", new Color(0.537643f, 0f, 0.067681f, 1f) }, { "FF0040", new Color(0.534119f, 0f, 0.135324f, 1f) }, { "FF0060", new Color(0.53256f, 0f, 0.206402f, 1f) }, { "FF0080", new Color(0.530953f, 0f, 0.284283f, 1f) }, { "FF009F", new Color(0.530311f, 0f, 0.347341f, 1f) }, { "FF00BF", new Color(0.535333f, 0f, 0.420806f, 1f) }, { "FF00DF", new Color(0.534267f, 0f, 0.490719f, 1f) }, { "FF00FF", new Color(0.532484f, 0f, 0.57136f, 1f) }, { "FF2000", new Color(0.532341f, 0.067751f, 0f, 1f) }, { "FF2020", new Color(0.521762f, 0.065674f, 0.068487f, 1f) }, { "FF2040", new Color(0.524024f, 0.066109f, 0.142031f, 1f) }, { "FF2060", new Color(0.523861f, 0.062883f, 0.207084f, 1f) }, { "FF2080", new Color(0.523915f, 0.061042f, 0.279725f, 1f) }, { "FF209F", new Color(0.522952f, 0.0616f, 0.347737f, 1f) }, { "FF20BF", new Color(0.522954f, 0.06288f, 0.416575f, 1f) }, { "FF20DF", new Color(0.52433f, 0.061369f, 0.485128f, 1f) }, { "FF20FF", new Color(0.528468f, 0.063597f, 0.563714f, 1f) }, { "FF4000", new Color(0.533891f, 0.124661f, 0f, 1f) }, { "FF4020", new Color(0.522896f, 0.125227f, 0.064738f, 1f) }, { "FF4040", new Color(0.526081f, 0.126399f, 0.140041f, 1f) }, { "FF4060", new Color(0.525482f, 0.123878f, 0.207067f, 1f) }, { "FF4080", new Color(0.525389f, 0.12413f, 0.279221f, 1f) }, { "FF409F", new Color(0.525291f, 0.123902f, 0.348582f, 1f) }, { "FF40BF", new Color(0.525477f, 0.123994f, 0.418168f, 1f) }, { "FF40DF", new Color(0.526202f, 0.124368f, 0.483684f, 1f) }, { "FF40FF", new Color(0.527539f, 0.124408f, 0.566436f, 1f) }, { "FF6000", new Color(0.533535f, 0.195436f, 0f, 1f) }, { "FF6020", new Color(0.52406f, 0.193349f, 0.067831f, 1f) }, { "FF6040", new Color(0.526691f, 0.193592f, 0.142529f, 1f) }, { "FF6060", new Color(0.526315f, 0.193369f, 0.209343f, 1f) }, { "FF6080", new Color(0.527048f, 0.192802f, 0.280516f, 1f) }, { "FF609F", new Color(0.522593f, 0.197741f, 0.346096f, 1f) }, { "FF60BF", new Color(0.526157f, 0.193149f, 0.42095f, 1f) }, { "FF60DF", new Color(0.526543f, 0.197768f, 0.488434f, 1f) }, { "FF60FF", new Color(0.527459f, 0.195278f, 0.567361f, 1f) }, { "FF8000", new Color((float)Math.E * 69f / 352f, 0.253015f, 0f, 1f) }, { "FF8020", new Color(0.523229f, 0.255644f, 0.068925f, 1f) }, { "FF8040", new Color(0.526963f, 0.25798f, 0.139085f, 1f) }, { "FF8060", new Color(0.527172f, 0.258862f, 0.208816f, 1f) }, { "FF8080", new Color(0.522921f, 0.258827f, 0.280436f, 1f) }, { "FF809F", new Color(0.525912f, 0.258752f, 0.350305f, 1f) }, { "FF80BF", new Color(0.527012f, 0.258293f, 0.418576f, 1f) }, { "FF80DF", new Color(0.52743f, 0.258984f, 0.489896f, 1f) }, { "FF80FF", new Color(0.528132f, 0.260477f, 0.563979f, 1f) }, { "FF9F00", new Color(0.532367f, 0.316974f, 0f, 1f) }, { "FF9F20", new Color(0.522643f, 0.316859f, 0.069456f, 1f) }, { "FF9F40", new Color(0.526839f, 0.317229f, 0.135867f, 1f) }, { "FF9F60", new Color(0.526801f, 0.318038f, 0.206837f, 1f) }, { "FF9F80", new Color(0.526429f, 0.322427f, 0.280273f, 1f) }, { "FF9F9F", new Color(0.526842f, 0.318622f, 0.347619f, 1f) }, { "FF9FBF", new Color(0.522344f, 0.318144f, 0.415608f, 1f) }, { "FF9FDF", new Color(0.526501f, 0.318196f, 0.483698f, 1f) }, { "FF9FFF", new Color(0.527856f, 0.31729f, 0.566889f, 1f) }, { "FFBF00", new Color(0.532024f, 0.388536f, 0f, 1f) }, { "FFBF20", new Color(0.526206f, 0.386756f, 0.068157f, 1f) }, { "FFBF40", new Color(0.525993f, 0.386578f, 0.142233f, 1f) }, { "FFBF60", new Color(0.525939f, 0.387063f, 0.207361f, 1f) }, { "FFBF80", new Color(0.522729f, 0.3881f, 0.279714f, 1f) }, { "FFBF9F", new Color(0.526735f, 0.388683f, 0.345444f, 1f) }, { "FFBFBF", new Color(0.526199f, 0.388414f, 0.416119f, 1f) }, { "FFBFDF", new Color(0.526435f, 0.387904f, 0.487854f, 1f) }, { "FFBFFF", new Color(0.527314f, 0.38902f, 0.567282f, 1f) }, { "FFDF00", new Color(0.533458f, 0.452596f, 0f, 1f) }, { "FFDF20", new Color(0.527611f, 0.446249f, 0.06921f, 1f) }, { "FFDF40", new Color(0.52656f, 0.445113f, 0.141155f, 1f) }, { "FFDF60", new Color(0.526352f, 0.452223f, 0.207652f, 1f) }, { "FFDF80", new Color(0.526439f, 0.445317f, 0.279462f, 1f) }, { "FFDF9F", new Color(0.526617f, 0.445313f, 0.346506f, 1f) }, { "FFDFBF", new Color(0.525768f, 0.445209f, 0.414502f, 1f) }, { "FFDFDF", new Color(0.526745f, 0.445205f, 0.489417f, 1f) }, { "FFDFFF", new Color(0.526692f, 0.452263f, 0.563086f, 1f) }, { "FFFF00", new Color(0.53138f, 0.528534f, 0f, 1f) }, { "FFFF20", new Color(0.522442f, 0.524125f, 0.0709f, 1f) }, { "FFFF40", new Color(0.526203f, (float)Math.E * 51f / 265f, 0.136952f, 1f) }, { "FFFF60", new Color(0.52159f, 0.522902f, 0.211855f, 1f) }, { "FFFF80", new Color(0.527102f, 0.52252f, 0.28128f, 1f) }, { "FFFF9F", new Color(0.527104f, 0.522628f, 0.349108f, 1f) }, { "FFFFBF", new Color(0.526829f, 0.522412f, 0.414272f, 1f) }, { "FFFFDF", new Color(0.5272f, 0.523332f, 0.482419f, 1f) }, { "FFFFFF", new Color(0.525369f, 0.524331f, 0.565046f, 1f) } }; } [HarmonyPatch(typeof(InventoryBook), "TurnOffScreens")] internal static class Patch_InventoryBook_TurnOffScreens { private static void Postfix(bool ShowBook) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) ColorPickerUI instance = ColorPickerUI.Instance; if (!((Object)(object)instance == (Object)null)) { if (ShowBook && (int)GameSettings.GetInstance().GameMode == 0) { instance.OnBookShown(); } else if (!ShowBook) { instance.OnBookHidden(); } } } } [HarmonyPatch(typeof(PiecePlacementCursor), "OnAccept")] internal static class Patch_PiecePlacementCursor_OnAccept { private static bool Prefix(PiecePlacementCursor __instance) { ColorPickerUI instance = ColorPickerUI.Instance; if ((Object)(object)instance == (Object)null) { return true; } return !instance.HandleEyedropperWorldAccept(__instance); } } [BepInPlugin("com.osqat.customcolors", "OssieCustomColors", "1.2.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Plugin : BaseUnityPlugin { public static ManualLogSource Log; public static ConfigEntry SavedColors; public static ConfigEntry ColorCorrectionExponent; public static ConfigEntry ColorCorrectionBrightness; private void Awake() { //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Expected O, but got Unknown //IL_0092: Unknown result type (might be due to invalid IL or missing references) Log = ((BaseUnityPlugin)this).Logger; SavedColors = ((BaseUnityPlugin)this).Config.Bind("Colors", "SavedColors", "", "Saved custom colors as comma-separated RRGGBB hex values"); ColorCorrectionExponent = ((BaseUnityPlugin)this).Config.Bind("Colors", "ColorCorrectionExponent", 2.4f, "Fallback exponent used when a color has no LUT entry. Darkens display colors before sending to the game renderer."); ColorCorrectionBrightness = ((BaseUnityPlugin)this).Config.Bind("Colors", "ColorCorrectionBrightness", 0.8f, "Fallback brightness multiplier applied after exponent correction when no LUT entry exists."); GameObject val = new GameObject("OssieCustomColors"); Object.DontDestroyOnLoad((Object)val); val.AddComponent(); new Harmony("com.osqat.customcolors").PatchAll(); Log.LogInfo((object)"[OssieCustomColors] loaded."); } }