In your database you must have a field where you tell whether the value is an expense or revenue. Let's say the name of this field is called 'type' . You can change the colors like this:
Two clicks on the onDrawColumnCell event of your DBGrid
If tabelaTIPO.Value = 'despesa' then // condição
begin
Dbgrid1.Canvas.Font.Color:= clRed; // coloque aqui a cor desejada
Dbgrid1.DefaultDrawDataCell(Rect, dbgrid1.columns[datacol].field, State);
end else
begin
Dbgrid1.Canvas.Font.Color:= clGreen; // coloque aqui a cor desejada
Dbgrid1.DefaultDrawDataCell(Rect, dbgrid1.columns[datacol].field, State);
end;
What the code does is check if in the TYPE field of your table it is 'expense', it looks red, otherwise it looks green. But you can choose the color you want.
In the example I mentioned, I made a condition using a string to make it easier, but I recommend using an integer 0 field for expense and 1 for revenue.