they can't confiscate your paint, sounds like you got played, UNLESS you live in an area where it is illegal to be out and about with spray paint on you, i.e. new york where i think its a misdemeanor just to carry that shit around. im not sure 100% but that could also be going on.
anyways, like whoever above me already said, you should be more aware of where you are parking, and how you look. if you are a sketchy looking kid running around town at 1 in the morning, you are gonna get stopped like that alot. or jumped and robbed.. either way. know where you're at and act/dress appropriately. AND FOR GODS SAKE DON'T LET THEM SEARCH YOUR BAG. not that saying "i don't consent" will lead to anything other than you having a prolonged detention, 5 more squad cars and getting searched and violated anyways.