Change color g.b.r.a. with a Slider

How can I change the color g . b . r . a . with a slider alredy present??

47948-unity-problem.gif

This is the script that change the color with the keywords g.b.r.a

using UnityEngine;
using UnityEngine;
using System.Collections;

public class colored : MonoBehaviour {
	
	public Color altColor = Color.black;
	public Renderer rend; 
	
	void Example() {         
		altColor.g = 0f;         
		altColor.r = 0f;        
		altColor.b = 0f;         
		altColor.a = 0f;     
	}      
	
	void Start ()
	{       
		Example();
		rend = GetComponent<Renderer>();
		rend.material.color = altColor;
	}      
	
	void Update() 
	{
		if (Input.GetKeyDown (KeyCode.G)){          
			altColor.g += 0.1f;
			rend.material.color = altColor;
		}
		if (Input.GetKeyDown (KeyCode.R)){        
			altColor.r += 0.1f;
			rend.material.color = altColor;
		}
		if (Input.GetKeyDown (KeyCode.B)){           
			altColor.b += 0.1f;
			rend.material.color = altColor;
		}
		if (Input.GetKeyDown (KeyCode.A)){ 
			altColor.a += 0.1f;
			rend.material.color = altColor;
		}
	}         
}

yes! its possible, you can use Unity’s new GUI system. there is a slider.
you have to use 4 sliders,each for each color (RGB) and one for alpha channel.
you can set its Min value to 0 and Max value to 255. and can map each slider to each color.

altColor.r = corresponding sliders value

altColor.g = corresponding sliders value

altColor.b = corresponding sliders value

altColor.a = corresponding sliders value

script reference : Redirect to... title of new-page