String offColour = attributes.getOffColor();
String onColour = attributes.getOnColor();
if (offColour != null) {
StyleColorName colorStyleValue =
StyleColorNames.getColorByName(offColour);
styles.getPropertyValues().setComputedAndSpecifiedValue(
StylePropertyDetails.COLOR, colorStyleValue);
}
if (onColour != null) {
StyleColorName colorStyleValue =
StyleColorNames.getColorByName(onColour);
styles.getNestedStyles(StatefulPseudoClasses.HOVER).
getPropertyValues().setComputedAndSpecifiedValue(
StylePropertyDetails.COLOR, colorStyleValue);