[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kfm-devel
Subject:    Re: text selection consistency
From:       Leo Savernik <l.savernik () aon ! at>
Date:       2003-09-28 18:18:41
[Download RAW message or body]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Am Sonntag, 28. September 2003 19:14 schrieb Germain Garand:
> {
> #define HUE_DISTANCE 15
> #define CONTRAST_DISTANCE 10
> int h1, s1, v1, h2, s2, v2;
> c1.hsv(&h1,&s1,&v1);
> c2.hsv(&h2,&s2,&v2);
> return QABS(h1-h2) > HUE_DISTANCE &&
>        QABS(s1-s2) + QABS(v1-v2) > CONTRAST_DISTANCE*2;
> #undef CONTRAST_DISTANCE
> #undef HUE_DISTANCE
> }

Thanks for that. The solution seems not to be slow because only integer 
arithmetic is involved in the rgb->hsv conversion. I incorporated it into 
khtml, encapsulated by #if, using your implementation by default.

mfg
	Leo


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE/dyYCj5jssenUYTsRAqkVAJ9jNVQRzUJtsT3I1fhuB3vPvkGERQCZAVPN
TkMqcLCP4EsU30WvcAYXyjg=
=WKKt
-----END PGP SIGNATURE-----

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic