Extension creating doubt

You will need to import the Color class as well:
android.graphics.Color.
As you are using one if its enums/constants here:

Note: for questions about extension development, you should ask in the app Inventor community:

The Discuss category is for discussion about kodular.
Thanks.