Uh oh!
There was an error while loading. Please reload this page.
Improve dialog color api - #454
Conversation
1f8d765 to
16d09bdComparest0012
commented
Jun 28, 2022
cc @nobu |
nobu
commented
Jun 29, 2022
Do you think fg and bg should be able to set separately? |
st0012
commented
Jun 30, 2022
I think having separate APIs that only take 1 argument is easier to understand. If we take 2 colors, the API name will be
And because |
16d09bd to
6efbc9cComparest0012
commented
Jul 1, 2022
After thinking about it, I think the lack of documentation shouldn't affect how we design an API. So please ignore this. With that being said, other configs don't seem to take multiple values yet? If that's true, I think it's another reason we should keep it to a single value API. |
st0012
commented
Jul 4, 2022
@nobu Let me know what you think. If you still think 2-value API is better, I'll change it. |
Uh oh!
There was an error while loading. Please reload this page.
6efbc9c to
d1ff43bCompareAs pointed out in the [comment](ruby#413 (comment)), the code is actually a control sequence and not only for colors. To make the dialog color APIs safer to use, we should restrict its usages and extract away the bg/fg concept from the input. So in this commit, I made these changes: 1. The dialog_*_bg/fg_color APIs only takes and returns color names (symbol): - :black - :red - :green - :yellow - :blue - :magenta - :cyan - :white 2. Add additional dialog_*_bg/fg_color_sequence APIs to access the raw code.
d1ff43b to
b32a977Comparest0012
commented
Jul 11, 2022
@hsbt Do you think the updated API looks good? |
nobu
commented
Jul 12, 2022
Looks much better than bare integers. 😃 |
As pointed out in the comment, the code is actually a control sequence and not only for colors.
To make the dialog color APIs safer to use, we should restrict its usages and extract away the bg/fg concept from the input.
So in this PR, I made these changes:
dialog_*_bg/fg_colorAPIs only takes and returns color names (symbol):dialog_*_bg/fg_color_sequenceAPIs to read the raw color sequences.Example