An RGB color is composed of three components: Red (0-255), Green (0-255) and Blue (0-255).
What exactly is BGR color space? How is it different from RGB color space?
It's just RGB in a more tightly controlled order, independent of endianness. Converting between them is simple once you know the endianness of your environment.
The BGR is a 24-bit representation where the lower-addressed 8 bits are blue, the next-addressed 8 are green and higher-addressed 8 are red.
RGB values tend to be written as RGB(r,g,b) where the r/g/b values are between 0 and 255 inclusive or as #rrggbb, where rr/gg/bb are 8-bit hex values. All the BGR values I've seen tend to be simple integers between 0 and 16777215 (0xffffff).