app/helpers/issue_types_helper.rb
# Find a sutiable color based on the background color
Find a sutiable color based on the background color
Find a sutiable color based on the background color
def text_color_for_bg(bg_color)
    if bg_color.length == 4
      r, g, b = bg_color[1, 4].scan(/./).map { |v| (v * 2).hex }
    else
      r, g, b = bg_color[1, 7].scan(/.{2}/).map(&:hex)
    end
    if r && g && b
      decide_color r, g, b
    else
      '#FFFFFF'
    end
  end
def text_color_for_bg ( bg_color ) if bg_color . length == 4 r , g , b = bg_color [ 1 , 4 ] . scan ( / . / ) . map { | v | ( v * 2 ) . hex } else r , g , b = bg_color [ 1 , 7 ] . scan ( / .{2} / ) . map ( & :hex ) end if r && g && b decide_color r , g , b else '#FFFFFF' end end
Find a sutiable color based on the background color
Find a sutiable color based on the background color
bg_color