| [ Return to Bugs & Features | Roadmap 1.1 | SVN ⇄ GIT ]
STR #837
Application: | FLTK Library |
Status: | 1 - Closed w/Resolution |
Priority: | 2 - Low, e.g. a documentation error or undocumented side-effect |
Scope: | 3 - Applies to all machines and operating systems |
Subsystem: | Core Library |
Summary: | fl_contrast gives poor results |
Version: | 1.1.6 |
Created By: | ajapted |
Assigned To: | mike |
Fix Version: | 1.1-current |
Update Notification: | |
Trouble Report Files:
Trouble Report Comments:
|
#1 | ajapted 04:25 Apr 28, 2005 |
| I'm writing a small editor program with syntax highlighting. I want comment text to be bright blue on the black background, but fl_contrast() forces it to white.
The test performed by fl_contrast (in 1.1.6) looks pretty ad-hoc to me. It ignores the blue channel completely, and the simple math ((A^B) & 0x80) considers 0 and 127 as equal, but 127 and 128 as a significant difference.
Hopefully this could be fixed ? | |
|
#2 | mike 10:08 May 12, 2005 |
| Fixed in Subversion repository.
Summary of fltk.bugs discussion: compute the luminosity and if the absolute difference is < 0.5, use the contrast color.
See attached patch... | |
[ Return to Bugs & Features ]
|
| |