Sha256: c33ccb88702ed5508a68b06fd5a7246d7dd6d0a3c3c2c8caef51e3769bfd7390
Contents?: true
Size: 262 Bytes
Versions: 2
Compression:
Stored size: 262 Bytes
Contents
class ColorDetector def initialize(value) @value = value end def color? # Check for 6-character (RGB) or 8-character (RGBA) hex color formats @value.is_a?(String) && @value.match?(/^#([0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$/) end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
solara-0.7.4 | solara/lib/core/scripts/color_detector.rb |
solara-0.7.3 | solara/lib/core/scripts/color_detector.rb |