Correct me if I am wrong, but do i understand correctly from your solution in the linked post that I need to create, write and read a dummy file for every single color I want, and that I am in fact creating a new Color object for each color I need? If that is the case, it doesn't solve my problem - I'm trying to avoid creating 100's of Color objects that will clog up my memory.
It is not clear why your workaround ould be better than just directly creating a new Color object via colors.add().
There's two types of colors in InDesign: named colors, and unnamed colors. Named colors show in the swatches panel, and unnamed colors don't.
There's no way to apply a unnamed color directly via scripting. The workaround I posted there was a way of applying unnamed colors.
I'm not clear on why you are concerned about hundreds of colors.