It sounds as if you want to bind the variable $color1 to the value of a the corresponding column in the current row. Check out the bind_col
methods of DBI
Update: As CPAN appears to be down, here is the basic syntax (grabbed from perldoc DBI);
$rc = $sth->bind_col($column_number, \$var_to_bind);
$rc = $sth->bind_columns(@list_of_refs_to_vars_to_bind);
The variables pretty much explain themselves ;-), but if you don't get it, do a perldoc DBI
(or equivalent) and find the complete doc.