Edit in JSFiddle

$("#change-color-button").click(function(){
	var red = Math.round(Math.random() * (255 - 0 + 1));
	var green = Math.round(Math.random() * (255 - 0 + 1));
	var blue = Math.round(Math.random() * (255 - 0 + 1));
	
	var rgbColor = "rgb(" + red + ", " + green + ", " + blue + ")";
	
	$("#animate-color-box").animate({backgroundColor: rgbColor}, "fast");
});


#animate-color-box{
	width: 100px;
	height: 100px;
	background-color: black;
}
<div id="animate-color-box"></div>
<button type="button" id="change-color-button">Vaheta värvi!</button>