Module: Inker

Defined in:
lib/inker.rb,
lib/inker/color.rb,
lib/inker/version.rb,
lib/inker/color/tools.rb,
lib/inker/color/serializers.rb

Overview

The main module of the gem, which loads all necessary classes and provides a helper for Color object generation from a string and for named colors map.

Defined Under Namespace

Classes: Color

Constant Summary collapse

VERSION =

Inker gem version

"0.1.0"

Class Method Summary collapse

Class Method Details

.color(str) ⇒ Inker::Color

Creates a new instance of Color, which could be used for color manipulation or for collecting color info.

Parameters:

Returns:



18
19
20
# File 'lib/inker.rb', line 18

def color(str)
  Color.new(str)
end

.named_colorsHash

Returns the map of named colors and their respective HEX representation.

Returns:

  • (Hash)

    a map of named colors and their HEX color



26
27
28
# File 'lib/inker.rb', line 26

def named_colors
  @named_colors ||= YAML.load_file(File.expand_path('../data/colors.yml', __FILE__))
end