设置文字颜色
函数原型
- color(int $color)
int $color
RGB 十六进制值
实例
- $config = ['path' => './tests'];
- $fileObject = new \Vtiful\Kernel\Excel($config);
-
- $fileObject = $fileObject->fileName('tutorial.xlsx');
- $fileHandle = $fileObject->getHandle();
-
- $format = new \Vtiful\Kernel\Format($fileHandle);
- $colorStyle = $format->color(0xFF0000)->toResource();
- //或 $colorStyle = $format->color(\Vtiful\Kernel\Format::COLOR_ORANGE)->toResource();
-
- $filePath = $fileObject->header(['name', 'age'])
- ->data([
- ['viest', 21],
- ['wjx', 21]
- ])
- ->setRow('A1', 50, $colorStyle)
- ->output();
-
- var_dump($filePath);