Module: OmgImage::OmgHelper

Included in:
ApplicationHelper
Defined in:
app/helpers/omg_image/omg_helper.rb

Constant Summary collapse

COLORS =
[
  {
    bg: "#19063A",
    text: "#dce9f3",
  },
  {
    bg: "#080E3B",
    text: "#ffffff",
  },
  {
    bg: "#010C1F",
    text: "#aebcd5",
  },
  {
    bg: "#d7dee2",
    text: "#022235",
  },
  {
    bg: "#161616",
    text: "#66e2d5",
  },
  {
    bg: "#1c0bba",
    text: "#c9d2dd",
  },
  {
    bg: '#449833',
    text: '#fff'
  },
  {
    bg: '#f31e25',
    text: '#fff'
  },
  {
    bg: '#f5681d',
    text: '#fff'
  },
  {
    bg: '#3d9fe1',
    text: '#fff'
  },
  {
    bg: '#930b99',
    text: '#fff'
  },
  {
    bg: '#f2169a',
    text: '#fff'
  },
].shuffle.freeze

Instance Method Summary collapse

Instance Method Details

#assigned_color(id = rand(COLORS.size)) ⇒ Object



54
55
56
# File 'app/helpers/omg_image/omg_helper.rb', line 54

def assigned_color(id = rand(COLORS.size))
  COLORS[id % COLORS.size]
end