Generate color legend for ceiling heights

Sorry, but I do not quite understand what you’re attaching. My question was about whether once you color a category according to a parameter, for example the ceilings according to their lag, if it was possible to automatically create a legend that indicates which color will refer each parameter value.Thank you