Project

General

Profile

« Previous | Next » 

Revision 36ca0e58

Added by st0012 (Stan Lo) almost 3 years ago

[ruby/reline] Use color name instead of code (integer) in dialog color APIs

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 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
  1. Add additional dialog_*_bg/fg_color_sequence APIs to access the raw code.

https://github.com/ruby/reline/commit/b32a977766