reworked rgb triplet handling