简体   繁体   English

PHPExcel:如何获得细胞颜色

[英]PHPExcel: How to get a CELL COLOR

I am using PHPExcel project, but I am having a question in mind, and without solution on the earth. 我正在使用PHPExcel项目,但我心中有一个问题,而且没有解决方案。

I had googled for this question for a while, but I CAN NOT find a way to get a CELL BACKGROUND COLOR! 我曾经谷歌搜索过这个问题一段时间了,但我找不到办法获得CELL背景颜色!

I tried to use the method 'getColor()' or what ... it doesn't work or just shows the warning message... 我尝试使用方法'getColor()'或者什么......它不起作用或只显示警告信息......

Can somebody please tell me how to get a CELL COLOR using PHPExcel? 有人可以告诉我如何使用PHPExcel获得CELL COLOR? THANKS 谢谢

$objPHPExcel->getActiveSheet()->getStyle('A1')->getFill()->getStartColor()->getARGB();

要么

$objPHPExcel->getActiveSheet()->getStyle('A1')->getFill()->getStartColor()->getRGB();

设置特定cell.it的背景对我有用

$objPHPExcel->getActiveSheet()->getStyle('A1')->getFill()->applyFromArray(array('type' => PHPExcel_Style_Fill::FILL_SOLID,'startcolor' => array('rgb' =>'FF1E1E')

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM