Sha256: ad8ba478784b21f7f52916ba8af10a377f4e55d9e6f0e7b7bebf65854e042d11

Contents?: true

Size: 1.28 KB

Versions: 2

Compression:

Stored size: 1.28 KB

Contents

<%
  # hsv_to_rgb メソッドは http://c4se.hatenablog.com/entry/2013/08/04/190937 をほぼコピーした
  def hsv_to_rgb(h, s, v)
    s /= 100.0
    v /= 100.0
    c = v * s
    x = c * (1 - ((h / 60.0) % 2 - 1).abs)
    m = v - c
    r, g, b = *(
      case
      when h < 60  then [c, x, 0]
      when h < 120 then [x, c, 0]
      when h < 180 then [0, c, x]
      when h < 240 then [0, x, c]
      when h < 300 then [x, 0, c]
      else              [c, 0, x]
      end
    )
    [r, g, b].map { |channel|
      ((channel + m) * 255).ceil
    }.map { |c|
      '%02x' % c
    }.join
  end

  hues = %w(
    225
    225
    264
    296
    160
    33
    43
    43
    43
    200
    93
    93
    93
    330
    340
    208
    208
    208
    208
    208
    208
  ).map(&:to_i)

  colors = hues.map { |h|
    [hsv_to_rgb(h, 100, 80), hsv_to_rgb(h, 100, 100)]
  }

  ids = (0..9).to_a + ('a'..'z').to_a
  colors.each.with_index(1) do |(color, active_color), index|
%>

#\:<%= ids[index] %> {
    .blocklyTreeRow {
        padding-top: 0.25em;
        padding-bottom: 0.25em;
        border-left: 0.75em solid #<%= color %>;
    }

    .blocklyTreeRow.blocklyTreeSelected {
        color: white;
        font-weight: bold;
        background-color: #<%= active_color %> !important;
    }
}

<% end %>

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
smalruby-editor-0.1.19-x86-mingw32 app/assets/stylesheets/toolbox.css.scss.erb
smalruby-editor-0.1.19 app/assets/stylesheets/toolbox.css.scss.erb