Hi frooli,

I'm not sure if I understand the question, but if you want to see
image search results in any color, then you could remove the
GimageSearch.RESTRICT_COLORFILTER. You would just get rid of the call
to colorSearcher.setRestriction Is that what you are looking for?

Happy coding,

Jeff

On Dec 30 2009, 4:41 am, frooli <[email protected]> wrote:
> hi there,
>
> i am experimenting with the sample code of the image-search. now i
> have embeded the color restriction, so that i can search for images in
> several colors. is there also a way to search overall colors ?
> actually the images are filtered by color. this ist the sample code i
> have used:
>
> google.load('search', '1');
>
>     function OnLoad() {
>       var searchControlDiv = document.getElementById("searchbox");
>       var control = new GSearchControl();
>       control.setResultSetSize(GSearch.LARGE_RESULTSET);
>       control.setLinkTarget(GSearch.LINK_TARGET_BLANK);
>
>       var options = new GsearcherOptions();
>
>       var isearcher;
>       var colors = [
>         GimageSearch.COLOR_RED,
>         GimageSearch.COLOR_ORANGE,
>         GimageSearch.COLOR_YELLOW,
>         GimageSearch.COLOR_GREEN,
>         GimageSearch.COLOR_TEAL,
>         GimageSearch.COLOR_BLUE,
>         GimageSearch.COLOR_PURPLE,
>         GimageSearch.COLOR_PINK,
>         GimageSearch.COLOR_WHITE,
>         GimageSearch.COLOR_GRAY,
>         GimageSearch.COLOR_BLACK,
>         GimageSearch.COLOR_BROWN
>       ];
>
>       for (var i=0; i < colors.length; i++) {
>         var colorSearcher = new google.search.ImageSearch();
>         colorSearcher.setRestriction
> (GimageSearch.RESTRICT_COLORFILTER,
>                                      colors[i]);
>         var colorName = colors[i].substring(0,1).toUpperCase() + colors
> [i].substring(1);
>         colorSearcher.setUserDefinedLabel(colorName);
>         control.addSearcher(colorSearcher, options);
>       };
>
>       // tell the searcher to draw itself and tell it where to attach
>       var drawOptions = new google.search.DrawOptions();
>       drawOptions.setDrawMode
> (google.search.SearchControl.DRAW_MODE_TABBED);
>       control.draw(searchControlDiv, drawOptions);
>     }
>
>     google.setOnLoadCallback(OnLoad);
>         //]]>
>
> thank you

--

You received this message because you are subscribed to the Google Groups 
"Google AJAX APIs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-ajax-search-api?hl=en.


Reply via email to