Microsoft
Software
Hardware
Network
Question : Calculating RGBA given different RGB colours.
Hello,
I have three RGB colours, background, foreground and target. The target colour is always between the background and foreground colours. Now, given these three RGB colours, I want to find out what the alpha channel of the foreground colour should be to give the closest approximation of the target colour that only had the RGB channels.
Any ideas on where I can even start this thing???
Thanks,
Uni
Answer : Calculating RGBA given different RGB colours.
depending n how you define closest, it may be
(rt+gt+bt)-(rb+gb+bb)/((rf
+gf+bf)-(r
b+gb+bb))
or
((rt-rb)/(rf-rb)+(gt-gb)/(
gf-gb)+(bt
-bb)/(bf-b
b))/3
perhaps with gamma or other correction
Random Solutions
Exchange 2010 inbound attachment size limit
What is Overloading?
SSRS 2008 ReportViewer1 control not maximized
.net Click Once With Silent Install
jquery Colorbox login form redirect
VB equation is slightly off
Unable to open PDF's in Outlook 2007, ""There was an error opening this document. This file cannot be found."
Windows 7 screen saver goes crazy "Bubbles"
Script to email newly created computers. Need to add groups & users accounts also.
Outlook 2007 hangs while sending large emails (only over HTTPS, not over VPN or while on LAN)