I am re-asking this question because my first attempt was erroneously marked as a duplicate, and I still have hope that someone might have an answer for me.
I am having to write my own mouse-over code for a particular control in a C++/VCL application. The question is, given ANY combination of foreground and background colors, how do you calculate a highlight color to indicate that the mouse is over that control?
I am NOT asking how to choose a font/text color based on the background color. That question has certainly been answered. What I need to do is choose a third color to use to highlight the item when the mouse is over it.
I was thinking I probably want to do something like take the background color, find its opposite on the color wheel (and I have no idea how to do that). If that color is too close (however you determine that) to the text color, make it lighter or darker.
Does anyone have an algorithm they are willing to share?
Thanks!