简体   繁体   English

如何在 Google Sheets 中获取单元格的字体颜色?

[英]How to get font color of cell in Google Sheets?

Is it possible to get the font color of a cell in Google Sheets?是否可以在 Google Sheets 中获取单元格的字体颜色?

I have found a script for getting the colour of the background using getBackground() .我找到了一个使用getBackground()获取背景颜色的脚本。 However, I can't find anything for text colour.但是,我找不到文本颜色的任何内容。

Yes there is a function called getFontColor() .是的,有一个名为getFontColor()的函数。

Check the google documentation for more spreadsheet related references.查看 google 文档以获取更多与电子表格相关的参考资料。

get this addon: https://chrome.google.com/webstore/detail/c获取此插件: https : //chrome.google.com/webstore/detail/c

and then you can use easy IF logic to get the color name:然后您可以使用简单的IF逻辑来获取颜色名称:

=IF(COUNTFONTCOLOR("A1", "A1")=1, "red")

00

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

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