Added event emittion code of red green blue