feat: add ability to have arrows of different colors on a board#18
feat: add ability to have arrows of different colors on a board#18loicraux wants to merge 1 commit intoMDLC01:mainfrom
Conversation
|
Thanks for the pull request! Ideally, all In terms of API, I was thinking the best way would be through an where Then, the
In the future, this |
|
Ok, I get your idea @MDLC01 , I agree it's better in terms of API. I'll try to find a moment next week to implement the same... |
Summary
Add ability to have arrows of different colors on a board.
Note
This pull request was not generated by an AI.
Description
The added new feature is the ability to draw arrows of different colors on a board. The user is introduced this new feature by being allowed to pass triplets instead of pairs as elements of the array given for the
arrowsoption. The third (and optional) element of the triplet would be the color of the arrow.The other ways to pass a value to the
arrowsoption as an array of strings (for example,("e2 e4", "e7 e5")or, more compactly,("e2e4", "e7e5")) remain unchanged.For example, one is now able to pass to the
arrowsoption such an array :(("e2", "e4", rgb("#a1d3e7")), ("e7", "e5", teal),("d2", "d4"))... If no third color element is passed then the default color specified byarrow-fillis used.Implementation
I updated in
src/lib.typthe arrow parsing logic to support triplets in thearrowsarray:(start, end, color).(start, end)or a string definition is provided, it falls back to the defaultarrow-fillcolor.Tests
I have added a new test in
src/api.typto test this new feature :Also no other already test did break during build with
python3 ./build.py. This change is backward compatible.Documentation
I have updated
src/README.mdto document this new featureRelated issue
Closes #17