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.6.54 lib/fedux_org_stdlib/colors/html_color.rb
fedux_org-stdlib-0.6.53 lib/fedux_org_stdlib/colors/html_color.rb
fedux_org-stdlib-0.6.52 lib/fedux_org_stdlib/colors/html_color.rb
fedux_org-stdlib-0.6.51 lib/fedux_org_stdlib/colors/html_color.rb
fedux_org-stdlib-0.6.50 lib/fedux_org_stdlib/colors/html_color.rb
fedux_org-stdlib-0.6.48 lib/fedux_org_stdlib/colors/html_color.rb
fedux_org-stdlib-0.6.47 lib/fedux_org_stdlib/colors/html_color.rb
fedux_org-stdlib-0.6.46 lib/fedux_org_stdlib/colors/html_color.rb
fedux_org-stdlib-0.6.45 lib/fedux_org_stdlib/colors/html_color.rb
fedux_org-stdlib-0.6.44 lib/fedux_org_stdlib/colors/html_color.rb
fedux_org-stdlib-0.6.43 lib/fedux_org_stdlib/colors/html_color.rb
fedux_org-stdlib-0.6.40 lib/fedux_org_stdlib/colors/html_color.rb
fedux_org-stdlib-0.6.39 lib/fedux_org_stdlib/colors/html_color.rb
fedux_org-stdlib-0.6.38 lib/fedux_org_stdlib/colors/html_color.rb
fedux_org-stdlib-0.6.37 lib/fedux_org_stdlib/colors/html_color.rb
fedux_org-stdlib-0.6.34 lib/fedux_org_stdlib/colors/html_color.rb
fedux_org-stdlib-0.6.33 lib/fedux_org_stdlib/colors/html_color.rb
fedux_org-stdlib-0.6.32 lib/fedux_org_stdlib/colors/html_color.rb
fedux_org-stdlib-0.6.31 lib/fedux_org_stdlib/colors/html_color.rb
fedux_org-stdlib-0.6.30 lib/fedux_org_stdlib/colors/html_color.rb