Merge pull request 'Choose light colors for the groups' (#96) from light-colors into main
Some checks failed
Check usage of free licenses / build-static-assets (push) Successful in 48s
Run unit tests / unit_tests (push) Successful in 1m38s
Build Nginx-based docker image / build-static-assets (push) Failing after 2m18s

Reviewed-on: #96
This commit is contained in:
bustikiller 2024-11-04 22:46:08 +00:00
commit cded122f22
3 changed files with 7 additions and 2 deletions

View File

@ -33,4 +33,5 @@ group :development do
gem 'web-console'
end
gem "solid_queue", "~> 1.0"
gem 'chroma'
gem 'solid_queue', '~> 1.0'

View File

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

View File

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