void Format::setColor (
mixed $color
)
Sets the color of a cell's content
mixed $color
-
either a string (like 'blue'), or an integer (range is [8...63]).
Please see the "Using colors" section of the manual for more information.
This function can not be called statically.
Using setColor()
<?php
require_once 'Spreadsheet/Excel/Writer.php';
$workbook = new Spreadsheet_Excel_Writer();
$worksheet = &$workbook->addWorksheet('SetColor');
for ($inc =0; $inc<64; $inc++) {
// Sets the color of a cell's content
$format = $workbook->addFormat();
$format->setColor($inc);
$worksheet->write($inc, 0, 'Color (index '.$inc.')', $format);
}
$workbook->send('setColor.xls');
$workbook->close();
?>