Trying to color rows in spreadsheet based on table and variable

Table sheet is as folllows:

var1 color
var2 color
va 3 color

My code needs to be
If cell x in sheet Y = varx
apply color to entirerow of sheet Y

Any help?