Add BBS::Color module with c() helper

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-30 10:34:36 +02:00
parent c01159dc23
commit bd8aa51684
2 changed files with 18 additions and 0 deletions

17
lib/bbs/color.rb Normal file
View File

@@ -0,0 +1,17 @@
# frozen_string_literal: true
module BBS
module Color
COLORS = {
reset: "\e[0m", gray: "\e[0;37m", yellow: "\e[0;33m",
white: "\e[1;37m", blue: "\e[0;34m", cyan: "\e[0;36m",
green: "\e[1;32m", magenta: "\e[0;35m", red: "\e[1;31m"
}.freeze
module_function
def c(color, text)
"#{COLORS.fetch(color)}#{text}#{COLORS[:reset]}"
end
end
end