简体   繁体   English

如何在Chrome扩展程序通知中更改图标的背景颜色

[英]how to change background color of icon in chrome extension notification

i have problem with chrome extension rich notification. 我对chrome扩展程序丰富的通知有问题。 My problem is about icon. 我的问题是关于图标的。 I'm getting icons from a server. 我正在从服务器获取图标。 But thesee icon's sizes are 120 * 60 Width: 120 Height: 60 但是thesee图标的大小是120 * 60宽度:120高度:60

My notification: 我的通知: 在此处输入图片说明

But i need 120 * 120. I tried to change height but failed. 但是我需要120 *120。我尝试更改高度,但失败了。 So i thought i can change background color. 所以我想我可以改变背景颜色。 Current icon background color is gray. 当前图标背景颜色为灰色。 I need to change it to white or transparent. 我需要将其更改为白色或透明。 I searched but i couldnt find. 我搜索了但找不到。 I hope you can help me about resize height or change background color of chrome extension notification icon. 希望您能帮助我调整高度或更改chrome扩展名通知图标的背景颜色。 Thanks. 谢谢。

There's no such thing in the notifications API . 通知API中没有这样的东西。

Use Canvas API ( some examples ) to manually create 120x120 px colored background, combine it with the downsized image and then output it in the notification. 使用Canvas API( 一些示例 )来手动创建120x120 px的彩色背景,将其与缩小的图像组合在一起,然后在通知中输出。

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

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