Styles¶
Fill¶
Use this style to define fill of a shape as example below.
$shape->getFill()
->setFillType(Fill::FILL_GRADIENT_LINEAR)
->setRotation(270)
->setStartColor(new Color('FFCCCCCC'))
->setEndColor(new Color('FFFFFFFF'));
Properties:
fillTyperotationstartColorendColor
Border¶
Use this style to define border of a shape as example below.
$shape->getBorder()
->setLineStyle(Border::LINE_SINGLE)
->setLineWidth(4)
->getColor()->setARGB('FFC00000');
Properties:
lineWidthlineStyledashStylecolor
Shadow¶
Use this style to define shadow of a shape as example below.
$shape->getShadow()
->setVisible(true)
->setDirection(45)
->setDistance(10);
Properties:
visibleblurRadiusdistancedirectionalignmentcoloralpha
Alignment¶
horizontalverticallevelindentmarginLeftmarginRight
Font¶
namebolditalicsuperScriptsubScriptunderlinestrikethroughcolor
Bullet¶
bulletTypebulletFontbulletCharbulletNumericStylebulletNumericStartAt
Color¶
Colors can be applied to different objects, e.g. font or border.
$textRun = $shape->createTextRun('Text');
$textRun->getFont()->setColor(new Color('C00000'));