Skip to content

Instantly share code, notes, and snippets.

@fukajun
Last active December 15, 2015 09:59
Show Gist options
  • Save fukajun/5242750 to your computer and use it in GitHub Desktop.
Save fukajun/5242750 to your computer and use it in GitHub Desktop.
色見本
- 16.times do |r|
- 16.times do |g|
- 16.times do |b|
- if (r + 1) % 4 == 0 && (g + 1) % 4 == 0 && (b + 1) % 4 == 0
%span{:style => "background-color:##{'%01x'%r + '%01x'%g + '%01x'%b}"}
hoge
- k = 0
- (0..15).each do |r|
- (0..15).each do |g|
- (0..15).each do |b|
- k += 1
- if k % 63 == 00
%span{:style => "background-color:##{'%01x'%r + '%01x'%g + '%01x'%b}"}
hoge
- k = 0
- (0..4095).each do |r|
- k += 1
- if k % 50 == 31
%span{:style => "background-color:##{'%03X'%r}"}
= '%03X'%r
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment