2 Replies Latest reply on Jul 21, 2009 4:06 AM by MstrPBK

    Converting RGB codes to HVS Codes ...

    MstrPBK

      Title

      Converting RGB codes to HVS Codes ...

      Post

      Version: FileMaker 8.5 Advanced

       

      I have a little programming skill but what skill I have is short by " " much to take other persons code and write a script to do the conversion of the RGB codes. Has anyone else done this and MIGHT they be willing to share that script with me?

       

      NstrPBK

      St. Paul MN USA

        • 1. Re: Converting RGB codes to HVS Codes ...
          comment_1
            

          Try:

           

           

          Let ( [ blu = B / 255 ; grn = G / 255 ; red = R / 255 ; V = Max ( red ; grn ; blu ) ; delta = V - Min ( red ; grn ; blu ) ; H = Case ( not delta ; 0 ; V = red ; 60 * ( grn - blu ) / delta ; V = grn ; 60 * ( blu - red ) / delta + 120 ; V = blu ; 60 * ( red - grn ) / delta + 240 ) ; S = Case ( not delta ; 0 ; delta / V ) ] ; "H: " & Mod ( Round ( H ; 0 ) ; 360 )  & ¶ & "S: " & Round ( 100 * S ; 0 ) & ¶ & "V: " & Round ( 100 * V ; 0 ) )

           

           

           

          • 2. Re: Converting RGB codes to HVS Codes ...
            MstrPBK
              

            Thank you very much for your information and time.

            I will give it a try ...There may still be questions along the way.

             

            MstrPBK

            St. Paul, MN USA