Could not determine discrete values to use for annotations

I’m trying to create a discrete color bar for my data.
When I click “Interpret Values as Categories” in the Color Map Editor I am presented with this warning:

image

Though my dataset consists of integers and has less than 32 discrete values.

I’m plotting by DebrisID.
image

Am I missing something or is this a bug?

Thanks,
Ted

And since I have to create each entry manually, is there any API available through the Python Shell to make that easier?

Alternatively, I know I could separately generate an xml colormap and load that in. But I would still want to be able to quickly update the values/annotations on the fly with a simple for loop.

Update:
Found the API through a trace.

So I can easily set all the Values/Annotations I need, but generating the colors (even random ones) is more difficult.

I could sit there and click the “Add new entry” button over and over to auto-generate some colors, but that’s less than ideal, even for a work-around.
Is there a way to access the “random” (I think it’s actually consistently random, starting with white, red, blue, green…) colors that this button produces so that I can replicate this behavior programmatically?

Please share your data ?

In any case, using a preconfigure color map should work, click on the “heart”.

After more testing, I see it’s only this one dataset that has this issue.
Unfortunately I cannot share it.

I’m trying to reproduce with one that I can.

The problem with the preconfigured discrete color maps is that they are obviously configured with a certain number of values/annotations, none of which match what I’m after.

In case I run into this again I plan on creating a map from scratch and saving it as a preset.

These colors come from the KAAMS color map preset in ParaView. A quick and dirty way to access them is:

lut = GetColorTransferFunction("dummy")
lut.ApplyPreset('KAAMS')
rgbColors = lut.IndexedColors
# rgbColors = [1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 0.0, 1.0, 0.0, 1.0, 0.0, 1.0, 1.0, 0.63, 0.63, 1.0, 0.67, 0.5, 0.33, 1.0, 0.5, 0.75, 0.53, 0.35, 0.7, 1.0, 0.75, 0.5]

The list of colors returns contain interleaved RGB values (white, red, green, blue, etc.).