public void ChangeColor(Color colorToEdit) { currentColor = colorToEdit; savedColor = colorToEdit; prevColor = colorToEdit; aValue = currentColor.a * 255f; rValue = currentColor.r * 255f; gValue = currentColor.g * 255f; bValue = currentColor.b * 255f; aText = aValue.ToString("F0"); rText = rValue.ToString("F0"); gText = gValue.ToString("F0"); bText = bValue.ToString("F0"); currentHSVColor = new HSBColor(currentColor); prevHSVColor = new HSBColor(currentColor); GenerateTextures(); rainbow = MaterialUtils.GenerateRainbowGradient(120, 20); aTexture = MaterialUtils.GenerateGradientTexture(100, 20, Color.black, Color.white); colorField = MaterialUtils.GenerateColorField(colorFieldSize, colorFieldSize, currentHSVColor.ToColor()); WindowPosition = new Rect(Screen.width / 2 - 100, Screen.height / 2f, 210, 100); showWindow = true; }