use of org.w3c.dom.css.RGBColor in project webtools.sourceediting by eclipse.
the class AbstractModelTest method checkPrimitiveRgb.
/* for rgb */
protected void checkPrimitiveRgb(CSSValue actual, Object[] expectedArray) {
assertTrue(actual instanceof CSSPrimitiveValue);
assertEquals(CSSPrimitiveValue.CSS_RGBCOLOR, ((CSSPrimitiveValue) actual).getPrimitiveType());
RGBColor color = ((CSSPrimitiveValue) actual).getRGBColorValue();
CSSPrimitiveValue value;
Object expected;
value = color.getRed();
expected = expectedArray[0];
if (expected instanceof PrimitiveNumber) {
checkPrimitiveNumber(value, (PrimitiveNumber) expected);
} else {
checkPrimitiveString(value, (PrimitiveString) expected);
}
value = color.getGreen();
expected = expectedArray[1];
if (expected instanceof PrimitiveNumber) {
checkPrimitiveNumber(value, (PrimitiveNumber) expected);
} else {
checkPrimitiveString(value, (PrimitiveString) expected);
}
value = color.getBlue();
expected = expectedArray[2];
if (expected instanceof PrimitiveNumber) {
checkPrimitiveNumber(value, (PrimitiveNumber) expected);
} else {
checkPrimitiveString(value, (PrimitiveString) expected);
}
}
Aggregations