rgba

CSS hexadecimal RGBA?

南笙酒味 提交于 2019-11-26 06:29:37
问题 I know you can write ... background-color: #ff0000; ... if you want something that is red. And you can write ... background-color: rgba(255, 0, 0, 0.5); ... if you want something red and translucent. Is there any terse way of writing partially transparent colors in hexadecimal? I want something like: background-color: #ff000088; <--- the 88 is the alpha ... or ... background-color: #ff0000 50%; I am getting all my colors in hexadecimal, and having to convert them all to the decimal 0-255

Convert RGBA PNG to RGB with PIL

左心房为你撑大大i 提交于 2019-11-26 03:48:49
问题 I\'m using PIL to convert a transparent PNG image uploaded with Django to a JPG file. The output looks broken. Source file Code Image.open(object.logo.path).save(\'/tmp/output.jpg\', \'JPEG\') or Image.open(object.logo.path).convert(\'RGB\').save(\'/tmp/output.png\') Result Both ways, the resulting image looks like this: Is there a way to fix this? I\'d like to have white background where the transparent background used to be. Solution Thanks to the great answers, I\'ve come up with the

CSS background opacity with rgba not working in IE 8

戏子无情 提交于 2019-11-26 02:41:32
问题 I am using this CSS for background opacity of a <div> : background: rgba(255, 255, 255, 0.3); It’s working fine in Firefox, but not in IE 8. How do I make it work? 回答1: Create a png which is larger than 1x1 pixel (thanks thirtydot), and which matches the transparency of your background. EDIT : to fall back for IE6+ support, you can specify bkgd chunk for the png, this is a color which will replace the true alpha transparency if it is not supported. You can fix it with gimp eg. 回答2: to