To encode the car color -I am guessing car color can take only 3 values: red, blue, green.
You can encode it as follows:
Color | Dummy_Var_One | Dummy_Var_Two |
Red | 1 | 0 |
Blue | 0 | 1 |
Green | 0 | 0 |
In the above table, Green will become the reference level. In your situation, if your color takes 'n' values then you will need to include n-1 dummy variables.
You can get the implementation in Java in the Weka filter NominalToBinary, this will create n variables for n categories.