<input name="color_1" value="<?php echo $color_1; ?>" />
<input name="color_2" value="<?php echo $color_2; ?>" />
<input name="color_3" value="<?php echo $color_3; ?>" />
<script src="https://code.jquery.com/jquery-2.1.4.js"></script>
<input name="color_1" value="<?php echo $color_1; ?>" />
<input name="color_2" value="<?php echo $color_2; ?>" />
<input name="color_3" value="<?php echo $color_3; ?>" />
$('input').on('click', function(){
var
$this = $(this),
newValue = 'new value';
$this.val(newValue);
});