availableColors not working

I’m trying to get aviableColors but I’m getting an error:
The model class RainLab\Translate\Models\MLThemeData must define a method \My\Plugin\Models\Styles::myColorList() returning html color HEX codes for the 'bg' form field.

In themes/default/theme.yaml I added colorpicker field:

bg:
    label: 'BG color'
    type: colorpicker
    availableColors: \My\Plugin\Models\Styles::myColorList
    allowCustom: true
    allowEmpty: true
    showAlpha: true
    span: auto

In styles model I added:

<?php namespace My\Plugin\Models;

use Event;

/**
 * Model
 */
class Styles extends Model
{
    public function myColorList($fieldName, $value, $formData)
    {
        return ['#000000', '#CCCCCC', '#FFFFFF'];
    }
}

How to make it work?

Theme.yaml is not expecting form field.

The theme information file theme.yaml contains the theme description, the author name, URL of the author’s website and some other information.

If you dont need the logic with color generations, just use the colors as array:

label: 'BG color'
    type: colorpicker
    allowCustom: true
    allowEmpty: true
    showAlpha: true
    span: auto
    availableColors: ['#000000', '#CCCCCC', '#FFFFFF']