# encoding: utf-8 require_library %w(geo_pattern) module FeduxOrgStdlib class Icon extend Forwardable def_delegator :@icon, :uri_image, :to_data_uri @patterns = %w(overlapping_rings xes mosaic_squares concentric_circles diamonds tessellation triangles squares) # see http://pln.jonas.me/xterm-colors for examples @colors = %w(#080808 #121212 #1c1c1c #262626 #303030 #3a3a3a #444444 #4e4e4e #585858 #626262 #6c6c6c #767676 #808080 #8a8a8a #949494 #9e9e9e #a8a8a8 b2b2b2 #bcbcbc #c6c6c6 #d0d0d0 #dadada #e4e4e4 #eeeeee) class << self attr_reader :patterns, :colors end def initialize(string, color: '#9e9e9e') @icon = GeoPattern.generate(string, color: color, patterns: Icon.patterns) end end end