module ThemeCatalog
Public Instance Methods
Source
# File lib/theme_catalog.rb, line 17 def all @all ||= [ fserve_theme, xdcc_theme, undernet_theme, neon_theme, compact_theme, sysinfo_theme, mircscript_theme, matrix_theme ].freeze end
Source
# File lib/theme_catalog.rb, line 260 def blackjack_paint_rules(title_fg:, title_bg:, total_fg:, total_bg:, card_fg:, card_bg:, tag_fg: nil, tag_bg: nil, count_fg: nil, count_bg: nil) tag_fg ||= title_fg count_fg ||= total_fg count_bg ||= total_bg tag_rule = { plugin: "blackjack", line: 1, pos: 39, fg: tag_fg } tag_rule[:bg] = tag_bg if tag_bg count_rule = { plugin: "blackjack", line: 1, pos: 53, fg: count_fg } count_rule[:bg] = count_bg if count_bg [ { plugin: "blackjack", line: 1, pos: 1, fg: title_fg, bg: title_bg }, tag_rule, count_rule, { plugin: "blackjack", line: 2, pos: 12, fg: total_fg, bg: total_bg }, { plugin: "blackjack", line: 2, pos: 17, fg: card_fg, bg: card_bg }, { plugin: "blackjack", line: 2, pos: 22, fg: card_fg, bg: card_bg }, { plugin: "blackjack", line: 3, pos: 12, fg: total_fg, bg: total_bg }, { plugin: "blackjack", line: 3, pos: 16, fg: card_fg, bg: card_bg }, { plugin: "blackjack", line: 3, pos: 21, fg: card_fg, bg: card_bg } ] end
Source
# File lib/theme_catalog.rb, line 157 def compact_theme palette = { title: [68, 88], tag: [71, 92], accent: [74, 89], footer: [94], count: [63, 91] } { id: "compact", name: "Compact Screen", width: :narrow, palette: palette, frame: { header_doodle: ["+== TAG ==+"], footer_doodle: ["+== /theme ==+"], separator: "--- * ---" }, paint_rules: paint_rules_for_palette(palette) } end
Source
# File lib/theme_catalog.rb, line 58 def fserve_theme palette = { title: [52, 88], tag: [59], accent: [56, 89], footer: [94], count: [63, 91] } width = 40 { id: "fserve", name: "Fserve Classic", width: :narrow, palette: palette, frame: { header_doodle: ThemeDoodle.fserver_banner(tag: "TAG", width: width).first(3), footer_doodle: ThemeDoodle.fserver_footer(width: width), separator: "-------- * --------" }, paint_rules: paint_rules_for_palette(palette) } end
Source
# File lib/theme_catalog.rb, line 30 def get(id) all.find { |theme| theme[:id] == id.to_s.downcase } end
Source
# File lib/theme_catalog.rb, line 233 def matrix_theme width = ThemeDoodleMatrix::BASE_WIDTH seed = "matrix".bytes.sum { id: "matrix", name: "The Matrix", width: :wide, doodle_style: :matrix, palette: { title: [3, 1], tag: [2, 1], accent: [3, 1], footer: [14], count: [1, 8] }, frame: { header_doodle: ThemeDoodleMatrix.matrix_header(tag: "TAG", width: width, seed: seed), between_doodles: ThemeDoodleMatrix.matrix_between_separators(width: width, count: 3, seed: seed), footer_doodle: ThemeDoodleMatrix.matrix_footer(width: width, seed: seed), separator: "======== BULLET TIME * MATRIX ========" }, paint_rules: paint_rules_for_palette( title: [3, 1], tag: [2, 1], accent: [3, 1], footer: [14], count: [1, 8] ) } end
Source
# File lib/theme_catalog.rb, line 207 def mircscript_theme width = ThemeDoodle::FSERVE_WIDTH { id: "mircscript", name: "mIRC Script 99", width: :wide, doodle_style: :rainbow, palette: { title: [52, 88], tag: [59, 92], accent: [56, 89], footer: [14], count: [63, 91] }, frame: { header_doodle: ThemeDoodle.fserver_banner(tag: "TAG", width: width), between_doodles: ThemeDoodle.fserver_separators(width: width, count: 4), footer_doodle: ThemeDoodle.fserver_footer(width: width), separator: "======== FSERVE * 99 COLOURS ========" }, paint_rules: paint_rules_for_palette( title: [52, 88], tag: [59, 92], accent: [56, 89], footer: [14], count: [63, 91] ) } end
Source
# File lib/theme_catalog.rb, line 125 def neon_theme { id: "neon", name: "Neon Wide", width: :wide, palette: { title: [52, 88], tag: [59, 92], accent: [56, 89], footer: [94], count: [63, 91] }, frame: { header_doodle: [ "+================================================================+", "| ~~ N E O N T H E M E ~~ |", "+================================================================+" ], between_doodles: ThemeDoodle.fserver_separators(width: 64, count: 2), footer_doodle: [ "+================================================================+", "| ~~ /theme ~~ |", "+================================================================+" ], separator: "================ ** ================" }, paint_rules: paint_rules_for_palette( title: [52, 88], tag: [59, 92], accent: [56, 89], footer: [94], count: [63, 91] ) } end
Source
# File lib/theme_catalog.rb, line 38 def paint_rules_for_palette(palette) title = Array(palette[:title] || [0, 4]) accent = Array(palette[:accent] || [1, 8]) tag = Array(palette[:tag] || [9]) count = Array(palette[:count] || [1, 8]) blackjack = blackjack_paint_rules( title_fg: title[0], title_bg: title[1], total_fg: accent[0], total_bg: accent.length == 2 ? accent[1] : nil, card_fg: tag[0], card_bg: tag.length == 2 ? tag[1] : title[1], tag_fg: tag[0], tag_bg: tag.length == 2 ? tag[1] : nil, count_fg: count[0], count_bg: count.length == 2 ? count[1] : nil ) card_plugins = PaintSamples.known.reject { |name| %w[blackjack progress].include?(name) } card_rules = ThemePaintRules.merge_for_palette(card_plugins, palette: palette) progress_rules = ThemePaintRules.progress_gutter_rules(palette: palette) blackjack + card_rules + progress_rules end
Source
# File lib/theme_catalog.rb, line 34 def resolve(id, custom: []) get(id) || Array(custom).find { |theme| theme[:id].to_s == id.to_s.downcase } end
Source
# File lib/theme_catalog.rb, line 179 def sysinfo_theme palette = { title: [52, 88], tag: [58, 89], accent: [56, 89], footer: [94], count: [63, 91] } { id: "sysinfo", name: "Sysinfo Margin", width: :wide, palette: palette, frame: { header_doodle: [ IrcAscii.margin_bar(label: "TAG", width: 56), "|---- sysinfo margin bar theme -----------------------|" ], footer_doodle: [ IrcAscii.margin_bar(label: "/theme", width: 56), "|---- stats footer strip -------------------------------|" ], separator: "[###] -------- [###]" }, paint_rules: paint_rules_for_palette(palette) } end
Source
# File lib/theme_catalog.rb, line 103 def undernet_theme palette = { title: [52, 88], tag: [59, 92], accent: [58, 89], footer: [94], count: [63, 91] } { id: "undernet", name: "Undernet Ibis", width: :medium, palette: palette, frame: { header_doodle: IrcAscii.ibis_box(label: "TAG", width: 24), footer_doodle: IrcAscii.ibis_box(label: "theme", width: 24), separator: "-------- - --------" }, paint_rules: paint_rules_for_palette(palette) } end
Source
# File lib/theme_catalog.rb, line 81 def xdcc_theme palette = { title: [52, 88], tag: [59, 92], accent: [60, 88], footer: [94], count: [63, 91] } { id: "xdcc", name: "XDCC Slot", width: :medium, palette: palette, frame: { header_doodle: IrcAscii.fserve_slot(label: "TAG :: READY", width: 40), footer_doodle: IrcAscii.fserve_slot(label: "pack complete :: /theme", width: 40), separator: "======== PACK ========" }, paint_rules: paint_rules_for_palette(palette) } end