lib/openc3/models/trigger_group_model.rb in openc3-5.4.2 vs lib/openc3/models/trigger_group_model.rb in openc3-5.4.3.pre.beta0
- old
+ new
@@ -15,11 +15,11 @@
# Modified by OpenC3, Inc.
# All changes Copyright 2022, OpenC3, Inc.
# All Rights Reserved
#
-# This file may also be used under the terms of a commercial license
+# This file may also be used under the terms of a commercial license
# if purchased from OpenC3, Inc.
require 'openc3/models/model'
require 'openc3/models/microservice_model'
require 'openc3/topics/autonomic_topic'
@@ -90,14 +90,13 @@
def update_color(color: nil)
if color.nil?
color = '#%06x' % (rand * 0xffffff)
end
- valid_color = color =~ /(#*)([0-9,a-f,A-f]{6})/
+ valid_color = color =~ /[0-9,a-f,A-F]{6}/
if valid_color.nil?
raise TriggerGroupInputError.new "invalid color must be in hex format. #FF0000"
end
-
unless color.start_with?('#')
color = "##{color}"
end
@color = color
end