imatrix and color implementation and tests

all tests succeeded