void OnGUI() { GUILayout.Label("RGB to Hex:", EditorStyles.boldLabel); colorToConvert = EditorGUILayout.ColorField("RGB Color:", colorToConvert); outputRgbHex = DarkRef.RGBtoHex(colorToConvert); if (colorToConvert != oldColor) { EditorPrefs.SetFloat("ColConvertR", colorToConvert.r); EditorPrefs.SetFloat("ColConvertG", colorToConvert.g); EditorPrefs.SetFloat("ColConvertB", colorToConvert.b); oldColor = colorToConvert; } EditorGUILayout.TextField("Hex Code:", outputRgbHex); DarkRef.GUISeparator(); GUILayout.Label("Hex to RGB:", EditorStyles.boldLabel); inputHexRgb = inputHexRgb.Substring(0, Mathf.Min(inputHexRgb.Length, 6)); inputHexRgb = EditorGUILayout.TextField("Hex Code:", inputHexRgb); EditorGUILayout.ColorField("RGB Color:", DarkRef.HexToRGB(inputHexRgb)); }
public void IncrementStack() { if (label == null) { return; } currentStack++; suffix = (currentStack >= 1) ? ("[" + DarkRef.RGBtoHex(new Color32(255, (byte)(255 - (Mathf.Clamp(currentStack - 1, 0, 6) * 38)), (byte)(255 - (Mathf.Clamp(currentStack - 1, 0, 6) * 45)), 255)) + "] (x" + currentStack.ToString() + ")[-]") : ""; lastActionTime = Time.time; afi.SetDuration(duration); afi.defaultSize = 1f + Mathf.Clamp((currentStack - 1) * 0.01f, 0f, 0.2f); afi.ImpulseAnimation(); }