Add class to first field in fields views How to add class to first fields in views?

I think that I need to add one if but I dont know what argument to put in if...

So how to add class just for first field in views-view-fields template.

{% for field in fields -%}
{%
        set colors = [
        'color-'~cycle(["red","yellow"],loop.index),
        loop.first ? 'first',
        loop.index== "1"?'color-first',
        ]
%}
        &lt;b {{ field.element_attributes.addClass(colors) }}&gt; {{ field.content }}&lt;/b&gt;
{%- endfor %}


This code do this :
You can use preprocess field hook which is supported in drupal 8 also .
Example below:

function example_preprocess_field(&amp;$variables) {
    if (($variables['element']['#field_name'] == 'example')) {
    $variables['attributes']['class'] = [
     'example'
      ];
  }
}