Template:Shade/bgcolor: Difference between revisions
Appearance
Added background color parameters (since alpha channel was effectively removed and wikitables have a grey background) |
m 1 revision imported: Import table cell templates |
||
(No difference)
|
Latest revision as of 20:44, 6 June 2021
rgb(({{{r}}}*{{{a}}}+{{{r_bg}}}*(1-{{{a}}})),({{{g}}}*{{{a}}}+{{{g_bg}}}*(1-{{{a}}})),({{{b}}}*{{{a}}}+{{{b_bg}}}*(1-{{{a}}})))

Calculates an rgba naively blended over a (by default) white background, i.e.
<math>C_o = C_a \alpha + 255 (1 - \alpha)</math>
{{Shade/bgcolor |r = <!-- red color component: 0-255 --> |g = <!-- green color component: 0-255 --> |b = <!-- blue color component: 0-255 --> |a = <!-- color transparency factor: 0.0-1.0 --> |r_bg = <!-- red background color component: 0-255 (default=255) --> |g_bg = <!-- green background color component: 0-255 (default=255) --> |b_bg = <!-- blue background color component: 0-255 (default=255) --> }}