You can try the following:
f = 0.568; % your float cm = colormap % returns the current color map colorID = max(1, sum(f > [0:1/length(cm(:,1)):1])); myColor = cm(colorID, :) % returns your color
The result for f = 0.568
is
myColor = 0.8125 1.0000 0.1875
source share