Choose light colors for the groups #96
3
Gemfile
3
Gemfile
@ -33,4 +33,5 @@ group :development do
|
|||||||
gem 'web-console'
|
gem 'web-console'
|
||||||
end
|
end
|
||||||
|
|
||||||
gem "solid_queue", "~> 1.0"
|
gem 'chroma'
|
||||||
|
gem 'solid_queue', '~> 1.0'
|
||||||
|
@ -84,6 +84,7 @@ GEM
|
|||||||
bootsnap (1.18.4)
|
bootsnap (1.18.4)
|
||||||
msgpack (~> 1.2)
|
msgpack (~> 1.2)
|
||||||
builder (3.3.0)
|
builder (3.3.0)
|
||||||
|
chroma (0.2.0)
|
||||||
coderay (1.1.3)
|
coderay (1.1.3)
|
||||||
concurrent-ruby (1.3.4)
|
concurrent-ruby (1.3.4)
|
||||||
connection_pool (2.4.1)
|
connection_pool (2.4.1)
|
||||||
@ -326,6 +327,7 @@ PLATFORMS
|
|||||||
|
|
||||||
DEPENDENCIES
|
DEPENDENCIES
|
||||||
bootsnap
|
bootsnap
|
||||||
|
chroma
|
||||||
csv
|
csv
|
||||||
debug
|
debug
|
||||||
factory_bot_rails
|
factory_bot_rails
|
||||||
|
@ -16,6 +16,8 @@ class Group < ApplicationRecord
|
|||||||
private
|
private
|
||||||
|
|
||||||
def set_color
|
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
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user