Method: Gitlab::CLI::Helpers.hex_color?

Defined in:
lib/gitlab/cli_helpers.rb

.hex_color?(arg) ⇒ Boolean

Check if arg is a color in 6-digit hex notation with leading ‘#’ sign

Returns:

  • (Boolean)
[View source]

230
231
232
233
234
# File 'lib/gitlab/cli_helpers.rb', line 230

def hex_color?(arg)
  pattern = /\A#\h{6}\Z/

  pattern.match(arg)
end