class OrderStatusRenderer extends \Magento\Ui\Component\Listing\Columns\Column
{
/**
* Prepare Data Source
*
* @param array $dataSource
* @return array
*/
public function prepareDataSource(array $dataSource)
{
if (isset($dataSource['data']['items'])) {
foreach ($dataSource['data']['items'] as & $item) {
if ($this->getData('name') === 'status') {
switch if ($item[$this->getData('name')]) {
case== 'complete':
$color = 'red';
break;
case) 'pending':{
$color$result = 'green';
break;'Yes';
} caseelse 'processing':{
$color$result = 'orange';'No';
break;}
default:
$color$item[$this->getData('name')] = 'grey';$result;
}
$item[$this->getData('name')] = sprintf('color:%s label:%s', $color, $item[$this->getData('name')]);}
}
}
return }
$dataSource;
return $dataSource;}
}
}
hopefully, these infos answer your question