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
Dynamics AX 2009 - AOS Performance
System Restore Points Not Created on Win 7
How many database instance that can be supported by SQL Server 2008 Standard Edition?
How to store a set in a field and how to maintain it dyamically?
Counting number of days between two dates using C#
Column Name in query
How can I prevent changes to web browser proxy settings?
PXE-E55: ProxyDHCP service did not reply to request on port 4011 Using SCCM 2007
How can i setup IIS on windows server 2008
How do I lookup and insert the foreign key value into a table when passing a variable value from different column in the related table?