Here is a C function to read the color registers of a BH1745 RGB sensor.
//**********************************************************
//* Read RGBC Registers via I2C
//**********************************************************
void readRGBC(void)
{
i2c_start();
i2c_write(BH1745_WR_ADDR); //slave address
i2c_write(rgbcDataBegin); //register address
i2c_start(); //repeated start
i2c_write(BH1745_RD_ADDR); //slave address
rgbcRaw[0] = i2c_read(1); //register data - ack
rgbcRaw[1] = i2c_read(1); //register data - ack
rgbcRaw[2] = i2c_read(1); //register data - ack
rgbcRaw[3] = i2c_read(1); //register data - ack
rgbcRaw[4] = i2c_read(1); //register data - ack
rgbcRaw[5] = i2c_read(1); //register data - ack
rgbcRaw[6] = i2c_read(1); //register data - ack
rgbcRaw[7] = i2c_read(0); //register data - nak
i2c_stop();
}