Sha256: 9f4349e68ab8716cfee92a124a1c5d13427d579c8d508fa09db2405a8dbd757b

Contents?: true

Size: 388 Bytes

Versions: 64

Compression:

Stored size: 388 Bytes

Contents

# encoding: utf-8
module FeduxOrgStdlib
  module Colors
    class HtmlColor
      # @param [String] color
      #   string in the html color format
      def initialize( color )
        @color = color
        @validator_regex = /^#[a-f0-9]{6}$/
      end

      # @return [true,false] color string is valid
      def valid?
        @validator_regex === @color
      end
    end
  end
end

Version data entries

64 entries across 64 versions & 1 rubygems

Version Path
fedux_org-stdlib-0.7.21 lib/fedux_org_stdlib/colors/html_color.rb
fedux_org-stdlib-0.7.20 lib/fedux_org_stdlib/colors/html_color.rb
fedux_org-stdlib-0.7.19 lib/fedux_org_stdlib/colors/html_color.rb
fedux_org-stdlib-0.7.18 lib/fedux_org_stdlib/colors/html_color.rb
fedux_org-stdlib-0.7.17 lib/fedux_org_stdlib/colors/html_color.rb
fedux_org-stdlib-0.7.16 lib/fedux_org_stdlib/colors/html_color.rb
fedux_org-stdlib-0.7.15 lib/fedux_org_stdlib/colors/html_color.rb
fedux_org-stdlib-0.7.14 lib/fedux_org_stdlib/colors/html_color.rb
fedux_org-stdlib-0.7.12 lib/fedux_org_stdlib/colors/html_color.rb
fedux_org-stdlib-0.7.11 lib/fedux_org_stdlib/colors/html_color.rb
fedux_org-stdlib-0.7.10 lib/fedux_org_stdlib/colors/html_color.rb
fedux_org-stdlib-0.7.8 lib/fedux_org_stdlib/colors/html_color.rb
fedux_org-stdlib-0.7.7 lib/fedux_org_stdlib/colors/html_color.rb
fedux_org-stdlib-0.7.6 lib/fedux_org_stdlib/colors/html_color.rb
fedux_org-stdlib-0.7.5 lib/fedux_org_stdlib/colors/html_color.rb
fedux_org-stdlib-0.7.4 lib/fedux_org_stdlib/colors/html_color.rb
fedux_org-stdlib-0.7.3 lib/fedux_org_stdlib/colors/html_color.rb
fedux_org-stdlib-0.7.2 lib/fedux_org_stdlib/colors/html_color.rb
fedux_org-stdlib-0.7.1 lib/fedux_org_stdlib/colors/html_color.rb
fedux_org-stdlib-0.7.0 lib/fedux_org_stdlib/colors/html_color.rb