Choose light colors for the groups
This commit is contained in:
parent
231ea3fda8
commit
5cceb1e6ed
3
Gemfile
3
Gemfile
@ -33,4 +33,5 @@ group :development do
|
||||
gem 'web-console'
|
||||
end
|
||||
|
||||
gem "solid_queue", "~> 1.0"
|
||||
gem 'chroma'
|
||||
gem 'solid_queue', '~> 1.0'
|
||||
|
@ -84,6 +84,7 @@ GEM
|
||||
bootsnap (1.18.4)
|
||||
msgpack (~> 1.2)
|
||||
builder (3.3.0)
|
||||
chroma (0.2.0)
|
||||
coderay (1.1.3)
|
||||
concurrent-ruby (1.3.4)
|
||||
connection_pool (2.4.1)
|
||||
@ -326,6 +327,7 @@ PLATFORMS
|
||||
|
||||
DEPENDENCIES
|
||||
bootsnap
|
||||
chroma
|
||||
csv
|
||||
debug
|
||||
factory_bot_rails
|
||||
|
@ -16,6 +16,8 @@ class Group < ApplicationRecord
|
||||
private
|
||||
|
||||
def set_color
|
||||
self.color = "##{SecureRandom.hex(3)}"
|
||||
new_color = "##{SecureRandom.hex(3)}".paint
|
||||
new_color = new_color.lighten(30) if new_color.dark?
|
||||
self.color = new_color
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user