I need help with TextBox2, maybe and error with the pallette

Hey everyone.

I’m trying to creating a TextBox2, but it doesn’t work.

I’m using this:

TextBox2(win, text=letter, font='Segoe UI', pos=(0, 0), units=None, letterHeight=None, color=(1.0,1.0,1.0), borderWidth=2, borderColor=None)

But in the Terminal of Spyder show this:

pygame 1.9.6
Hello from the pygame community. https://www.pygame.org/contribute.html
C:\Users\--\anaconda3\envs\Proyecto\lib\site-packages\pyglet\media\codecs\wmf.py:838: UserWarning: [WinError -2147417850] No se puede cambiar el modo de subproceso después de establecerlo
  warnings.warn(str(err))
C:\Users\--\anaconda3\envs\Proyecto\lib\site-packages\pyglet\image\codecs\wic.py:292: UserWarning: [WinError -2147417850] No se puede cambiar el modo de subproceso después de establecerlo
  warnings.warn(str(err))
Traceback (most recent call last):

  File "C:\Users\....", line 78, in <module>
    borde = psychopy.visual.TextBox2(win, text=letter, font='Segoe UI', pos=(0, 0), units=None, letterHeight=None, color=(1.0,1.0,1.0), borderWidth=2, borderColor=None)

  File "C:\Users\--\anaconda3\envs\Proyecto\lib\site-packages\psychopy\visual\textbox2\textbox2.py", line 204, in __init__
    self.pallette = { # If no focus

  File "C:\Users\--\anaconda3\envs\Proyecto\lib\site-packages\psychopy\visual\textbox2\textbox2.py", line 240, in pallette
    pal['lineRGB'] = pal['lineColor'] = [max(c - 0.05, 0.05) for c in self.win.color]

  File "C:\Users\--\anaconda3\envs\Proyecto\lib\site-packages\psychopy\visual\textbox2\textbox2.py", line 240, in <listcomp>
    pal['lineRGB'] = pal['lineColor'] = [max(c - 0.05, 0.05) for c in self.win.color]

TypeError: unsupported operand type(s) for -: 'str' and 'float'

Is something related in the pallette atribute of the class TextBox2.

I don’t know why I can’t use the normal TextBox…

And I’ve changed all the values, I just put the first code as an example.

I hope that you can help me guys, and sorry for my english.

Essentially, when the border colour of a Textbox is None, it still needs to get a colour for the border when the textbox is selected, so it uses the window colour. It attempts to darken this colour by subtracting 0.05 from each RGB value, however this is failing as your window colour is specified in a different colour space.

This is an error which should (hopefully!) soon be fixed, however this won’t be implemented until the next major release as it’s something which will be fixed along with a big overhaul of how colours are handled.

So, as a quick fix, you should either give the Textbox an RGB value for borderColor or change the colour space of the window to rgb