module PaintApply
PaintApply — apply stored colour overrides to sample/output line arrays. Public: to_lines Depends: IrcPaint Tests: test/plugins/paint_test.rb
Public Instance Methods
Source
# File lib/paint_apply.rb, line 13 def to_lines(lines:, overrides:) updated = Array(lines).map(&:to_s) Array(overrides).each do |override| index = override[:line].to_i - 1 next if index.negative? || index >= updated.length updated[index] = IrcPaint.recolor_range( updated[index], plain_start: override[:plain_start], plain_end: override[:plain_end], fg: override[:fg], bg: override[:bg] ) end updated end