Change colour of text dependent on immediate background colour
Some of my jobs involve text being placed on a background image or company logo. Often,, this background has wildly contrasting colours/shades and the text immediately in front of it becomes invisible. I then change the colour of that text from, say, black to white, to render it visible again.
Unfortunately, if there are then any amendments to the text, the white text now lies over a light background and becomes invisible. Currently, I just go over the text with a beady eye and make the amendments accordingly.
Is it, would it, be possible for there to be a script, plug-in or similar that says,"'if the background is darker than this shade, make the text white but if the background is lighter than this shade, make the text black". Obviously, the colours/shading would be flexible.
Many thanks.
-
Virgil Ierubino commented
This could also potentially be a new blend mode.
The way this works might be as follows:
If the background luminosity is not different enough from the foreground, the foreground's luminosity is shifted in the opposite direction (bias to lightening). Eg.
Background: 25%, Foreground: 75%. Luminosity sufficiently different. Foreground unchanged.
Background: 25%, Foreground: 30%. Luminosity too close. Foreground luminosity shifted away from Background, to 80%.
Background: 75%, Foreground: 65%. Luminosity too close. Foreground luminosity shifted away from Background, to 30%.
Background: 47%, Foreground: 47%. Luminosity the same. Foreground luminosity shifted away from Background, bias to the lightening direction, to 70%.
The exact algorithm for determining the new luminosity I leave to Adobe, based on the use case and goal of text readability. Ideally it should reflect the original text colour in a sensible way.