Color variation by id shader - [Maya,Arnold]

I wonder if there’s some way to change the color of the meshes with variation based on the id or influence of another object or other characteristic, but only with one material.
I notice this can be done easily with the colorJitter node in Arnold although it is a random variation and I would want to control each color mesh by its id.