public function color_sql($filter)
{
$this->db->select('*, sum(count) AS color_sum');
$this->db->from('wallpapers_colors');
$this->db->where('saturation BETWEEN ' . (float)(($filter['saturation'][0]) / 100) . ' AND ' . (float)(($filter['saturation'][1]) / 100), NULL, FALSE);
$this->db->where('lightness BETWEEN ' . (float)(($filter['lightness'][0]) / 100) . ' AND ' . (float)(($filter['lightness'][1]) / 100), NULL, FALSE);
$this->db->where('hue BETWEEN ' .(float)($filter['hue'][0]) . ' AND ' . (float)($filter['hue'][1]), NULL, FALSE);
$this->db->group_by('wallpaper_seq_id');
return $this->sql();
}