I'll first list the scenario I think you are talking about, to make sure I understand it correctly:
1. You are developing a custom bar/column chart visual.
2. The data-points' colors are to be specified in a column in your data, instead of using Power BI's color pallette, and will be passed to the visual via a "field well".
3. You're asking how to set the colors shown in the legend to the ones passed in the color "field well".
If this is in fact the scenario, then the solution is fairly simple-
ILegend's drawLegend() method is passed a LegendData object, which has a dataPoints property of the type LegendDataPoint[].
The dataPoints array is to be populated with LegendDataPoint objects, one for each data-point you want to show in the legend. One of LegendDataPoint's properties is the color property, in which(as its name suggests) you specify the data-point's legend color.
So basically, as you iterate through your DataView/ViewModel to populate the dataPoints array, you set the color property to that of the current data-point.
Hope this helps.
EDITED:
By the way, if you are asking about creating a modified version of one the existing visuals, say the column chart, notice that the LegendDataPoint[] array is created in its converter() method and populated using the data returned from the following function call: "converterStrategy.getLegend(colors, defaultLegendLabelColor, defaultDataPointColor);". Therefore, in order to change the way the data-points are colored in the legend, you'll have to write a modified version of the converterStrategy.getLegend() method.
Also, notice that if you modify an existing visual, then it might not function properly, since custom visuals are sandboxed, while the Microsoft-approved ones are not, and therefore have limited access to the visuals API.