1 Reply Latest reply on Apr 22, 2009 9:02 AM by Gregory Lafrance

    best way to search colors

    Starlover_jacob Level 1

      Hi there,


      Please some help with my problem.


      What I am doing is saving records in a sqlite db. Each record has some data and a color.

      In that color field i save 6 colors like this: 66ffff^0^66^0^ff00^0

      So on my screen i have 6 color pickers and i save the selected colors in the db with a special character between them. (In my case the ^)


      Now my problem;

      I want to create a search by color.

      But when i give the user a color picker.. and he/she selects red to search for, i have numerous color nuances that could define as red.


      something like this:

      f37575 = red

      f03737 = red

      a31a1a = red


      Is there a nice solution to get all items that have a red like color? (of course not only red, but lets say the main colors red, yellow, green, blue, purple)

      Or perhaps another solution to achieve this?


      please some help,


      Greets, jacob

        • 1. Re: best way to search colors
          Gregory Lafrance Level 6

          Colors are not subjective in a sense, but when you are dealing with numbers that introduce slight variations in colors, you are forced to more deeply understand how those colors are represented using the numbers.


          In this case, you need to determine what range of colors you consider red, blue, green, etc. because one person may say a given number represents red, but another may say at the far end of the spectrum, it is less like red and more like orange.


          Is the last VBox background in the following app red or orange?


          <?xml version="1.0" encoding="utf-8"?>
          <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
            <mx:VBox width="100" height="100" backgroundColor="0xf37575"/>
            <mx:VBox width="100" height="100" backgroundColor="0xf03737"/>
            <mx:VBox width="100" height="100" backgroundColor="0xa31a1a"/>
            <mx:VBox width="100" height="100" backgroundColor="0xFF0000"/>
            <mx:VBox width="100" height="100" backgroundColor="#E86C2E"/>