I should start by clarifying that query and Index are not alternatives of each other.
When a table is created, columns are defined and some of these columns can be defined as FOREIGN KEYS, relating to other column(s) in another table. The relation between tables is only useful for referential integrity purposes (if the engine supports it). It's also useful for documentation purposes and some query designers use them to guess the joins in a query.
The indexes (or indices) serve a different purpose. They tell the database to create an additional data structure that servers to speed-up retrieval of rows base on values of the indexed columns.
So, FOREIGN KEYs define relationships between tables, queries join the related tables, and indexes speed up the joining, filtering, grouping, and sorting operations in a query.
Edit: A table is used to represent a type of entity. So, we could have a table for colors with two attributes: colors(color_name, color_value). Color_value could be an hex string or an integer representation. In principle, we would not have a column for the color code in format rgb(x,y,z) because this can always be computed from the first.
We would have another table to keep the list of images. However, there is no relation between the table of colors and the table of images.
Edit 2: The second type is usually represented with two tables. The first table stores a typical hierarchical relation and the second table tells which classes each colour is labelled with. So, your relational model for the examples you provide would be:
colors(colorid, color_name, color_value)
color_classes(classid, classname, parentid)
colors_classes(colorid, classid)
e.g.,
(colorid, color_name, color_value) - colors
(1, 'Navy', 'xxx')
(classid, classname, parentid) - color_classes
(1, 'All colors', 0)
(2, 'Dark colors', 1)
(3, 'Light colors', 1)
(4, 'Jewel Tones', 2) -- assuming Jewel Tones is a subdivision of Dark Colors
(colorid, classid) - colors_classes
(1, 4) -- assuming Jewel Tones is a subdivision of Dark Colors
You should also be aware that recursive relations (as in color_classes) are not gracefully handled in the relational model, but they are still quite common and there are solutions to deal with it.
Finally, I'm not sure that the relational model is indeed the best for your problem. It will depend on the use you want to make of the data.