I think, that is a task for a database. Generate a new database file with the embedded HSQLDB. Mark your data in Calc and drag it to the table container in the Database UI. Check to generate a primary key and to use the first line as column names in the import wizard. Import all columns.
Generate a query in SQL view using the SQL command
SELECT "Vehicel", COUNT( DISTINCT "Colour" ) FROM "Table1" GROUP BY "Vehicel"
I have assumed, that you use the default table name Table1.
Unfortunately the function COUNT(DISTINCT …) is not available for a spreadsheet as database, so you need to convert your data to the HSQLDB format. Do you really want to calculate on that data? It is likely, that the things you want to do can be better done in a database anyway.
And here a suggestion to do it using a pivot table. Ask_PivotCountDistinct.ods.
Main idea: Put the category as column field and the characteristic attributes as row field. Put characteristic attributes as data field with aggregate function COUNT. Show row total. If the category does not has the attribute, the field is empty, but the other fields contain numbers. Therefore a simple count of the data area will give the number of distinct attributes. To get the range of the data area I search for the text “Total Result”. This way the pivot table may shrink or grow depending on the data. The top-left field of the pivot table is named, so that it can easily be used in the pivot table layout dialog and in my range calculation. For other details look at the used formulas.