vrnimje / quick-ftxui

A Quick & Easy way to render terminal user interfaces, using FTXUI.
https://vrnimje.github.io/quick-ftxui-docs/
5 stars 1 forks source link

[Feature] Adding color functionality, on a component level #2

Closed vrnimje closed 1 year ago

vrnimje commented 1 year ago

FTXUI provides coloring functionality. So, Quick-FTXUI should at least support its simple, 16 color pallete, which is given below:

Proposed Grammer

Red Button {
    "Exit",
    "Exit"
}
vrnimje commented 1 year ago

So after playing around with this in FTXUI's repository, it seems that for each component, there is a different method to decorate it with color.

For example, in Button, the normal | decorator operator works, for Simple and Ascii options But for Animated, the Animated() ButtonOption actually takes a color argument, and is not affected by |

But for Slider, the SliderOption struct can be modified for the required color.

Also, there is a need to update FTXUI's repository to v4.0.0, as it supports SliderOptions as well, which also allow us to modify color, which is currently not supported by either of the above methods.

vrnimje commented 1 year ago

Implemented Color with Buttons

https://github.com/vrnimje/quick-ftxui/assets/103848930/001b388d-6e37-496e-bffc-091ce8d94b19

vrnimje commented 1 year ago

Implemented color with Sliders Couple of problems which I faced

https://github.com/vrnimje/quick-ftxui/assets/103848930/938ae80a-fd95-4de9-ab55-46bbf3ea6caa

vrnimje commented 1 year ago

Implemented color with Input and Menu components

https://github.com/vrnimje/quick-ftxui/assets/103848930/a0f9f2fa-85ef-4352-9d14-4057e90b2e04

https://github.com/vrnimje/quick-ftxui/assets/103848930/9aa846bc-3480-4932-9aa8-de10f3a2339e

vrnimje commented 1 year ago

Implemented color for Toggle and Dropdown

https://github.com/vrnimje/quick-ftxui/assets/103848930/7bd81207-a29c-406a-9815-7fc3a08e9945

vrnimje commented 1 year ago

Now the only thing left to do is add update unit tests with coloring options, and update the Readme to reflect the changes