Closed sleimanx2 closed 8 years ago
I actually use both , hex is handy when used in css while rgb is useful if you want search images by colors.
for instance you would query elasticsearch with the following query
[
[
'range' => [
'images.main_color_rgb.r' => [
"gte" => $color['r'] - $tolerance,
"lte" => $color['r'] + $tolerance
]
]
],
[
'range' => [
'images.main_color_rgb.g' => [
"gte" => $color['g'] - $tolerance,
"lte" => $color['g'] + $tolerance
]
]
],
[
'range' => [
'images.main_color_rgb.b' => [
"gte" => $color['b'] - $tolerance,
"lte" => $color['b'] + $tolerance
]
]
]
]
Ok seems legit ^^ I let some comments and I'll test it later.
Thanks.
Closed by aba310ceef94f922c00949313e74a97dec7fb0a9. I'll work on the tests later.
I wonder if I can consider this out of scope, would you really use an array of RGB values instead of an hex string?