# frozen_string_literal: true module GoodJob class BaseChart def start_end_binds end_time = Time.current start_time = end_time - 1.day [ ActiveRecord::Relation::QueryAttribute.new('start_time', start_time, ActiveRecord::Type::DateTime.new), ActiveRecord::Relation::QueryAttribute.new('end_time', end_time, ActiveRecord::Type::DateTime.new), ] end def string_to_hsl(string) hash_value = string.sum hue = hash_value % 360 saturation = (hash_value % 50) + 50 lightness = '50' "hsl(#{hue}, #{saturation}%, #{lightness}%)" end end end