I have a table of polygons named 'testtable'. Within it is a column 'color', which has hex codes.

I want to style the polygons based on the hexcode values.

Is this possible?

I was trying something like this, but it's obviously not working..

# testtable{
  polygon-fill: {color};
  • This link is essentially the same thing I'm looking for... I fear it might not be implemented yet. link
    – AASIO
    Mar 23, 2014 at 3:30

1 Answer 1


No, it doesn't work with the current system. Buuuut, there is a pretty complex workaround. Take a look at the CartoCSS attached lower down in this example,


Basically, it encodes a logical statement for 200+ named colors in my column to create a hex.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.