Yes, you can reverse the order of colors in a custom stacked bar chart that uses pbiColorNominal by using the reverse() function to reverse the order of the color values in the array that is passed to pbiColorNominal.
Please see the example below, which show how you can reverse the order of colors:
let colors = ['#FF0000', '#00FF00', '#0000FF'];
let colorScale = visuals.colors.createColorScale('categorical', { colors: colors.reverse() });
visuals.colors.SQExprUtils.exprFromResultName('Category')
.getMetadata({ kind: SQExprKind.Column })
.then(columnMetadata => {
let colorExpr = visuals.createStaticEval('Category', columnMetadata);
let colorFunc = colorScale.getKeyColor.bind(colorScale);
let colorExprVal = visuals.converterHelper.colorExpressionRewriter(colorExpr.expr, colorFunc);
let colorExprRewritten = { expr: colorExprVal, source: 'Color' };
let stackedBarChart = new visuals.StackedBarChart('divId', colorExprRewritten);
// Use the stacked bar chart as desired
});
The colors array, in the example above, is reversed using the reverse() function before being passed to pbiColorNominal.