public static String getEffectiveBackgroundColor(Element element) {

        String backgroundColor = CmsDomUtil.getCurrentStyle(element, Style.backgroundColor);
        if ((CmsStringUtil.isEmptyOrWhitespaceOnly(backgroundColor)
            || isTransparent(backgroundColor)
            || backgroundColor.equals(StyleValue.inherit.toString()))) {

            if ((Document.get().getBody() != element) && (element.getParentElement() != null)) {

                backgroundColor = getEffectiveBackgroundColor(element.getParentElement());
            } else {
                // if body element has still no background color set default to white
                backgroundColor = "#FFFFFF";
            }
        }

        return backgroundColor;
    }
public static String getEffectiveBackgroundColor ( Element element ) { String backgroundColor = CmsDomUtil . getCurrentStyle ( element , Style . backgroundColor ) ; if ( ( CmsStringUtil . isEmptyOrWhitespaceOnly ( backgroundColor ) || isTransparent ( backgroundColor ) || backgroundColor . equals ( StyleValue . inherit . toString ( ) ) ) ) { if ( ( Document . get ( ) . getBody ( ) != element ) && ( element . getParentElement ( ) != null ) ) { backgroundColor = getEffectiveBackgroundColor ( element . getParentElement ( ) ) ; } else { backgroundColor = "#FFFFFF" ; } } return backgroundColor ; }
Utility method to determine the effective background color.<p>

@param element the element

@return the background color