source code of the rgb example