function [matrix,dominant_norm] = change_basis_matrix(dominant_color)
r = [1,0,0];
g = [0,1,0];
b = [0,0,1];

dominant_norm = norm(dominant_color);
dominant_color = dominant_color ./ dominant_norm;

rotateAxis = cross(r,dominant_color);
rotateAxis = rotateAxis ./ norm(rotateAxis);
angleRot = acos(dot(r,dominant_color));

rnew = rotVecAroundAxis(r',rotateAxis,angleRot);
gnew = rotVecAroundAxis(g',rotateAxis,angleRot);
bnew = rotVecAroundAxis(b',rotateAxis,angleRot);

%gnew = rotVecAroundAxis(gnew,rnew,1);
%bnew = rotVecAroundAxis(bnew,rnew,1);

matrix = [ rnew';gnew';bnew'];

end
