Sha256: 69a9539825c9ea4eac4a99c91d71ff230e2230c00a45b501070c1ecd8af9e846
Contents?: true
Size: 625 Bytes
Versions: 19
Compression:
Stored size: 625 Bytes
Contents
# 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
Version data entries
19 entries across 19 versions & 1 rubygems