Choose light colors for the groups #96

Merged
bustikiller merged 1 commits from light-colors into main 2024-11-04 22:46:08 +00:00
3 changed files with 7 additions and 2 deletions

View File

@ -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'

View File

@ -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

View File

@ -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