Solved

Calculating RGBA given different RGB colours.

Posted on 2010-08-26
4
230 Views
Last Modified: 2012-05-10
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
0
Comment
Question by:Unimatrix_001
  • 3
4 Comments
 
LVL 84

Accepted Solution

by:
ozo earned 500 total points
ID: 33532897
depending n how you define closest, it may be
(rt+gt+bt)-(rb+gb+bb)/((rf+gf+bf)-(rb+gb+bb))
or
((rt-rb)/(rf-rb)+(gt-gb)/(gf-gb)+(bt-bb)/(bf-bb))/3
perhaps with gamma or other correction
0
 
LVL 3

Author Comment

by:Unimatrix_001
ID: 33533637
Hi ozo,

Very sorry for not getting back sooner, thanks very much - I'll give them a go this evening and let you know how things are.

Thanks again,
Uni
0
 
LVL 3

Author Comment

by:Unimatrix_001
ID: 33534928
Very well done ozo... I really am jealous how you seems to just know how to solve any maths issue... :(
0
 
LVL 3

Author Closing Comment

by:Unimatrix_001
ID: 33534929
Brilliant!
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Excel - convert k M or G suffix to real number 6 101
CAGR Calculation For SIP 13 60
Math Stumper 6 39
Word Problem 4 62
Complex Numbers are funny things.  Many people have a basic understanding of them, some a more advanced.  The confusion usually arises when that pesky i (or j for Electrical Engineers) appears and understanding the meaning of a square root of a nega…
Foreword (May 2015) This web page has appeared at Google.  It's definitely worth considering! https://www.google.com/about/careers/students/guide-to-technical-development.html How to Know You are Making a Difference at EE In August, 2013, one …
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now