I am trying to use Conditional Statements to assign distinguished colors to 10 different polygons within my shapefile. I want to have control over selection of the color for each polygon. Therefore I :
- Opened Attribute Table
- Select features using an expression
- Selected Fields and Values ( I chose the ID attribute)
did something like this in expression window :
CASE
WHEN "ID"=36 THEN color_rgb(0,102,204)
WHEN "ID"=50 THEN color_rgb(255,128,0)
WHEN "ID"=63 THEN color_rgb(0,204,0)
WHEN "ID"=77 THEN color_rgb(204,0,0)
WHEN "ID"=104 THEN color_rgb(255,0,255)
WHEN "ID"=123 THEN color_rgb(102,51,0)
WHEN "ID"=128 THEN color_rgb(255,153,255)
WHEN "ID"=130 THEN color_rgb(128,128,128)
WHEN "ID"=143 THEN color_rgb(204,204,0)
WHEN "ID"=163 THEN color_rgb(0,204,204)
ELSE color_rgb(0,0,0)
END
Now when I press Select Features I expect to have 10 colorful polygons as the result, however by doing this I only get a new color for all the polygons.