Maybe you should look to optimize the process before automating instead. RPA has great ways of finding duplicates in DataTables: https://docs.uipath.com/activities/docs/remove-duplicate-rows - why let the robot work with colors like stoopid hoomans?
Just for completeness let me also address your original issue: If you want to insert a row after the last cell with a specific color, read the full range, use a for each row activity and declare the row index in a variable. Then get the color for the cell by adding desired column letter and the excel row number, which is your row index + an offset of usually 2 (row 0 in datatable is row 2 in excel). Check if the color is your expected color. If it is not, insert the row at that index and break from the for each row loop.