Sha256: 885e370214e38cbed32554b66d7426ed3e0b5a4f7f7e6aef8bccfb05b710a416

Contents?: true

Size: 1.44 KB

Versions: 2

Compression:

Stored size: 1.44 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(
    208
    208
    208
    208
    270
    300
    160
    330
    330
    33
    43
    43
    43
    43
    190
    100
    100
    100
    100
    340
    340
    340
  ).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 {
        margin-bottom: 1px;
        padding-top: 1px;
        padding-bottom: 1px;
        color: white;
        background-color: #<%= color %> !important;

        span.blocklyTreeIcon, span.blocklyTreeLabel {
          font-size: 14px;
        }
    }

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

<% end %>

div.blocklyTreeRoot {
    padding: 0;
}

Version data entries

2 entries across 2 versions & 1 rubygems

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