Skip to content

Commit

Permalink
add double_underline and overline effect
Browse files Browse the repository at this point in the history
Learnt these from ku1ik/rainbow#125
  • Loading branch information
MidAutumnMoon committed Sep 15, 2024
1 parent c574169 commit be60ffd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ Full list of methods for applying terminal effects:
* `#invert`
* `#hide`
* `#strike`
* `#double_underline`
* `#overline`

Demo:

Expand Down
10 changes: 7 additions & 3 deletions lib/reinbow/color/effects.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,16 @@ module Reinbow
invert: 7,

# Conceal or hide
# (Windows Terminal do support this effect,
# a bit suprised)
hide: 8,

# Crossed-out, or strike
strike: 9,
}.transform_values { Effect.new( _1 ) }

# Doubly underlined
double_underline: 21,

# Overlined
overline: 53,
}.transform_values { Effect.new( _1 ) }.freeze

end

0 comments on commit be60ffd

Please sign in to comment.