Hello Juraj,
the reason why your code doesn't work is located in OBClassSortFilter>>displayString:forParent:child: . This filter is evaluated after the OBTraitColorFilter. The string which is passed to this method is your created Text. But in this method a new String (which is a ByteString) is constructed. There your text attribute is lost.
If I have some time later on I will look for a workaround.
Regards Robert