implementation of size and color (see comments in source)