Assuming you're representing the sequences as lists of r,g, and b (since prolog interprets capitals as variables), and you want to accept an empty sequence, you want something like:
gbr(g,b,r).
accept([]).
accept([X]).
accept([X,Y]):-X /== Y.
accept([X,Y,Z|Xs]):-
X /== Y,
not gbr(X,Y,Z),
accept([Y,Z|Xs]).