Actually I did hit the divide by zero error, which is why I added the
min/max test. But your solution was better.
--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
On October 6, 2016 9:08:42 PM hh <h...@hyperhh.de> wrote:
Peter M.B. wrote:
But isn’t there something more fundamentally wrong with this measure,
with the criteria outlined by Sannyasin:
* Small text should have a contrast ratio of at least 4.5:1 against
its background. A ratio of 7:1 is preferred.
* Large text (at 14 pt bold/18 pt regular and up) should have a
contrast ratio of at least 3:1 against its background.
If you’re comparing something with black, it’s very easy to get a high
luminance ratio but text will still be unreadable. Try setting a field’s
forecolor to 5,5,5 and the backcolor to 45,45,45. The luminance ratio
is 8.27, but you can’t read the text at all.
You are convincing with your example, of course.
As the script-link given by Colin shows, the matter is very complicated
(and complicated to code). I'm not at all an expert with luminance, do
such things by trial and error.
Jacques probably tried by intention to give a simple method and forgot to
exclude the divide-by-zero part. That's why I cited the contrast "formula".
_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your
subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode