cubing / algdb

📚 Algorithm Database
http://algdb.net
GNU General Public License v3.0
22 stars 3 forks source link

Custom colorschemes #7

Open coder13 opened 4 years ago

coder13 commented 4 years ago

My proposal to support various puzzles would be that the colorscheme is a user-puzzle-colorscheme table where colorscheme is an array of colors.

big213 commented 4 years ago

Do you have a list of colors that you think should be available? Looks like these were the colors on the current algdb.net.

8-28-2020 7-54-44 AM

big213 commented 4 years ago

Updated the schema here: 73c68b4

The colors are represented by a stringified array of color codes, so like [1,2,3,4,5]. Another approach is to make the colors its own table and then create a proper link between user, puzzle, and color, but I figured the stringified array would be more efficient and it suits the purpose just fine.

Yet another approach, which would be the most efficient on the backend, would be to store the color schemes as a stringified JSON object in the user table, and there could be validation to ensure the object has been formatted properly, etc.