From IFWiki

ROY G. BIV is a mnemonic acronym for the seven colors of the rainbow in their correct order: Red, Orange, Yellow, Green, Blue, Indigo, and Violet. The name "ROY G. BIV" is used as a hint that the seven colors must be manipulated in that order somewhere in the game.

For example, if the player learns that a museum uses Roy G. Biv Electronic Security Systems and later finds seven differently colored pushbuttons scattered in different rooms in that museum, then the player should know to first push the red button, then push the orange button, and so on.

(Admittedly, "ROY G. BIV" as a hint is a bit dated now, and is usually only found in older games.)]