psychopy / psychojs

PsychoJS is the online counterpart of the PsychoPy Python library
MIT License
162 stars 66 forks source link

Color: PsychoJS uses `util.Color` while PsychoPy uses `colors.Color` #471

Open TEParsons opened 2 years ago

TEParsons commented 2 years ago

This causes problems like this user was having: https://github.com/psychopy/psychopy/issues/4344

when auto translating from Python to JS - if they were in the same place, they'd be able to do colors.Color('red') in Python and it would be new colors.Color('red') in JS. I can add to the transcriber that colors.Color needs to translate as util.Color, but in the interest of synchronicity shouldn't the libraries be structured the same as much as possible?

apitiot commented 2 years ago

Since there is no "colors" sub-directory under the "psychopy" directory, I would advocate for the transpiler to take care of this. Also "Color.js" would be very lonely in its own "colors" sub-directory.