我想基于Int创建一个颜色对象.我可以使用sealedclass获得相同的结果和enum并且想知道一个是否比另一个更好。使用sealedclass:sealedclassSealedColor(valvalue:Int){classRed:SealedColor(0)classGreen:SealedColor(1)classBlue:SealedColor(2)companionobject{valmap=hashMapOf(0toRed(),1toGreen(),2toBlue())}}valsealedColor:SealedColor=SealedColor.map[0]!!w