Closed vrnimje closed 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.
Implemented Color with Buttons
https://github.com/vrnimje/quick-ftxui/assets/103848930/001b388d-6e37-496e-bffc-091ce8d94b19
Implemented color with Sliders Couple of problems which I faced
SliderOption<T>
currently doesn't support a label, so had to use hbox in Renderer() to render it the way previous Slider()
rendershttps://github.com/vrnimje/quick-ftxui/assets/103848930/938ae80a-fd95-4de9-ab55-46bbf3ea6caa
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
Implemented color for Toggle and Dropdown
https://github.com/vrnimje/quick-ftxui/assets/103848930/7bd81207-a29c-406a-9815-7fc3a08e9945
Now the only thing left to do is add update unit tests with coloring options, and update the Readme to reflect the changes
FTXUI provides coloring functionality. So, Quick-FTXUI should at least support its simple, 16 color pallete, which is given below:
Proposed Grammer