Chaning RGB of Object with GUI Slider

I want to change the color of an object with a GUI Silder - The object has a number of children and I want to change their color as well - the Hierarchy looks like this.

Mesh 1
Mesh 2
Mesh 3

Each child object has a mesh renderer with 1 element - which has Reflective/Specular shader

This is the code I have been using - I can get the GUI Sliders to show up an work but cannot figure out how to get it to change the color of my objects

using UnityEngine;
using System.Collections;

public class ChangeColor : MonoBehaviour {

//public Color myColor;
private float rSlider = 0.0f;
private float bSlider = 0.0f;
private float gSlider = 0.0f;
public GameObject slab;
private Color myColor;
public MeshRenderer rend;

void Start () {
	rend = GetComponentInChildren<MeshRenderer>();

void OnGUI () {
    myColor = RGBSlider (new Rect (10,10,200,10), myColor);

Color RGBSlider (Rect screenRect, Color rgb) {
	rSlider = GUI.HorizontalSlider (screenRect, rSlider, 0.0f, 1.0f);

    // <- Move the next control down a bit to avoid overlapping
    screenRect.y += 20; 
	gSlider = GUI.HorizontalSlider (screenRect, gSlider, 0.0f, 1.0f);

    // <- Move the next control down a bit to avoid overlapping
    screenRect.y += 20; 

	bSlider = GUI.HorizontalSlider (screenRect, bSlider, 0.0f, 1.0f);
    return rgb;

	slab.GetComponentInChildren<MeshRenderer>.material.color = myColor;



i have tried a number of lines at the end but they all give errors

renderer.material.color = myColor;
renderer.material.color = new color (rSlider, gSlider, bSlider);
GameObject.GetComponentInChildren.material.color etc;
gameObjcet.GetCompnentsInchildren.render.material.color etc

Any help much appreciated

public Color color;
public float rslider = 0f;
public float gslider = 0f;
public float bslider = 0f;

void OnGUI () {
		GUILayout.Label ("Red: ");
		rslider = GUILayout.HorizontalSlider(rslider, 0, 255);

		GUILayout.Label ("Green: ");
		gslider = GUILayout.HorizontalSlider(gslider, 0, 255);

		GUILayout.Label ("Blue: ");
		bslider = GUILayout.HorizontalSlider(bslider, 0, 255);

		color = new Color(rslider, gslider, bslider);

void Update () {
      if (Input.GetKeyDown(KeyCode.E)) {
            gameobject.GetComponent<MeshRenderer>().material.color = color;

Hey dempseyg,

I made a 1 on this subject, and if you want to check it out, the code and completed project are included in the description.

Have a good day!