Sha256: fb388be1e8a8a7f8335efd09481093e1d430d8c60af676d064c6482b11780799

Contents?: true

Size: 1.17 KB

Versions: 10

Compression:

Stored size: 1.17 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
    264
    296
    33
    43
    43
    43
    200
    93
    93
    340
    208
  ).map(&:to_i)

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

  colors.each.with_index(1) do |(color, active_color), index|
%>

#\:<%= '%x' % 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

10 entries across 10 versions & 1 rubygems

Version Path
smalruby-editor-0.1.4-x86-mingw32 app/assets/stylesheets/toolbox.css.scss.erb
smalruby-editor-0.1.4 app/assets/stylesheets/toolbox.css.scss.erb
smalruby-editor-0.1.3-x86-mingw32 app/assets/stylesheets/toolbox.css.scss.erb
smalruby-editor-0.1.3 app/assets/stylesheets/toolbox.css.scss.erb
smalruby-editor-0.1.2-x86-mingw32 app/assets/stylesheets/toolbox.css.scss.erb
smalruby-editor-0.1.2 app/assets/stylesheets/toolbox.css.scss.erb
smalruby-editor-0.1.1-x86-mingw32 app/assets/stylesheets/toolbox.css.scss.erb
smalruby-editor-0.1.1 app/assets/stylesheets/toolbox.css.scss.erb
smalruby-editor-0.1.0-x86-mingw32 app/assets/stylesheets/toolbox.css.scss.erb
smalruby-editor-0.1.0 app/assets/stylesheets/toolbox.css.scss.erb