Sha256: 725b948b23ca176fdb551ddce84f161cd17290b49a8c087137624452dd59677f
Contents?: true
Size: 595 Bytes
Versions: 56
Compression:
Stored size: 595 Bytes
Contents
# encoding: utf-8 module FeduxOrgStdlib module Colors # HTML color # # Helps you to check if given string is a valid html color class HtmlColor # @param [String] color # string in the html color format def initialize(color) @color = color @validator_regex = /^#[a-f0-9]{6}$/ end # Is color valid? # @return [true,false] color string is valid def valid? # rubocop:disable Style/CaseEquality @validator_regex === @color # rubocop:enable Style/CaseEquality end end end end
Version data entries
56 entries across 56 versions & 1 rubygems