/** * Answers the style property containing the Global Background Color for the theme * * @return ref object StyleProperty * @access public * @since 5/30/06 */ function getGlobalBGColor() { $globalStyles = $this->_theme->getGlobalStyles(); // empty SP for returning if SP is 'background' $return = new BackgroundColorSP(); if (isset($globalStyles['body'])) { $body = $globalStyles['body']; $SPs = $body->getSPs(); if (isset($SPs['background-color'])) { return $SPs['background-color']; } else { if (isset($SPs['background'])) { $SCs = $SPs['background']->getSCs(); if (isset($SCs['colorsc'])) { $return->addSC($SCs['colorsc']); } } } } return $return; }
function test_color_sps() { $sp = new ColorSP("#23FF12"); $this->assertIdentical($sp->getDisplayName(), "Color"); $this->assertIdentical($sp->getDescription(), "This property specifies the foreground color."); $this->assertIdentical($sp->getCSS(), "color: #23FF12;"); $sp = new BackgroundColorSP("#23FF12"); $this->assertIdentical($sp->getCSS(), "background-color: #23FF12;"); }