There are two ways to accomplish this. If you want to colour your polygon layer based on hard-coded values, you can achieve this by obtaining the HEX colour from the layer and assigning it to your SLD variable, where "Color" is the field containing HEX values.
<PolygonSymbolizer>
<Fill>
<CssParameter name="fill">
<ogc:PropertyName>Color</ogc:PropertyName>
</CssParameter>
</Fill>
<Stroke>
<CssParameter name="stroke">#000000</CssParameter>
<CssParameter name="stroke-width">1</CssParameter>
</Stroke>
</PolygonSymbolizer>
In another case, you can use the interpolate approach so you don't need to specify any hard-coded colour value in your data. In the following code, "Value" is the field you want to symbolize your data based on that.
<PolygonSymbolizer>
<Fill>
<CssParameter name="fill">
<ogc:Function name="Interpolate">
<!-- Property to transform -->
<ogc:PropertyName>Value</ogc:PropertyName>
<!-- Mapping curve definition pairs (input, output) -->
<ogc:Literal>0</ogc:Literal>
<ogc:Literal>#fefeee</ogc:Literal>
<ogc:Literal>9000000</ogc:Literal>
<ogc:Literal>#00ff00</ogc:Literal>
<ogc:Literal>23000000</ogc:Literal>
<ogc:Literal>#ff0000</ogc:Literal>
<!-- Interpolation method -->
<ogc:Literal>color</ogc:Literal>
<!-- Interpolation mode - defaults to linear -->
</ogc:Function>
</CssParameter>
</Fill>
</PolygonSymbolizer>