Color Conversion - RGB to HSV and back... (almost)

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Color Conversion - RGB to HSV and back... (almost)

Mike Kerner via use-livecode
Hi All,

Download this GUI Stack for Scott Raney's Color Conversion Functions:
RGB to HSV and HSV to RGB from this forum post:
http://forums.livecode.com/viewtopic.php?f=10&t=29127

Only for certain colors this is a lossy conversion: Once you convert some
RGB colors to HSV, the function HSVtoRGB does not convert them back
exactly as they were before.

Does anyone knows or have created a pair of RGB/HSV color conversion
functions that do not lose (or change) color information?

Thanks in advance!

Al
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Color Conversion - RGB to HSV and back... (almost)

Mike Kerner via use-livecode
Al,  I wrote some color conversion routines a long time ago. They are in
the MasterLibrary:

https://www.dropbox.com/s/3wpwn3hfbmpl7sk/MasterLibrary.livecode?dl=0

I cant comment on their ability to not loose precision on a round trip.

-= Mike


On 4/13/17 6:14 PM, Alejandro Tejada via use-livecode wrote:

> Hi All,
>
> Download this GUI Stack for Scott Raney's Color Conversion Functions:
> RGB to HSV and HSV to RGB from this forum post:
> http://forums.livecode.com/viewtopic.php?f=10&t=29127
>
> Only for certain colors this is a lossy conversion: Once you convert some
> RGB colors to HSV, the function HSVtoRGB does not convert them back
> exactly as they were before.
>
> Does anyone knows or have created a pair of RGB/HSV color conversion
> functions that do not lose (or change) color information?
>
> Thanks in advance!
>
> Al
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode