0

我希望能够使用自定义颜色,但似乎无法绕过 styleColor 常量。如何输入我自己的颜色,如 #008080

// Create slide
echo date('H:i:s') . ' Create slide'.EOL;
$oSlide1 = $objPHPPresentation->getActiveSlide();
$oSlide1->addShape(clone $oShapeDrawing);
$oSlide1->addShape(clone $oShapeRichText);
// Slide > Background > Color
$oBkgColor = new Color();
$oBkgColor->setColor(new StyleColor(StyleColor::COLOR_DARKGREEN));
$oSlide1->setBackground($oBkgColor);
4

1 回答 1

0

你可以这样做:

// Create slide
echo date('H:i:s') . ' Create slide'.EOL;
$oSlide1 = $objPHPPresentation->getActiveSlide();
$oSlide1->addShape(clone $oShapeDrawing);
$oSlide1->addShape(clone $oShapeRichText);
// Slide > Background > Color
$oColor = new StyleColor();
$oColor->setRGB('008080');
$oBkgColor = new Color();
$oBkgColor->setColor($oColor);
$oSlide1->setBackground($oBkgColor);
于 2018-02-13T08:35:59.670 回答