Create a gist now

Instantly share code, notes, and snippets.

anonymous /color-app.rb
Created May 14, 2015

What would you like to do?
黒背景での文字色サンプル表示(Ruby、Sinatra)
# -*- coding: utf-8 -*-
# 色のリストは以下のURLより
# http://www.colordic.org/y/
require 'rubygems'
require 'sinatra'
helpers do
include Rack::Utils; alias_method :h, :escape_html
def colors
return {
"コーラルレッドcoral red" => "#ef857d",
"サンシャインイエローsunshine yellow" => "#ffedab",
"アイスグリーンice green" => "#a3d6cc",
"ウイスタリアwistaria" => "#8d93c8",
"ピンクアーモンドpink almond" => "#e3acae",
"ポピーレッドpoppy red" => "#ea5550",
"クリームイエローcream yellow" => "#fff3b8",
"ターコイズグリーンturquoise green" => "#00947a",
"ブルーラベンダーblue lavender" => "#a4a8d4",
"ローズダストrose dust" => "#e6c0c0",
"レッドred" => "#ea5550",
"ネープルスイエローnaples yellow" => "#fdd35c",
"シーグリーンsea green" => "#00ac97",
"パンジーpannsy" => "#4d4398",
"ホワイトwhite" => "#ffffff",
"トマトレッドtomato red" => "#ea5549",
"トパーズtopaz" => "#e9bc00",
"ペパーミントグリーンpeppermint green" => "#00ac9a",
"バイオレットviolet" => "#5a4498",
"スノーホワイトsnow white" => "#fafdff",
"バーミリオンvermilion" => "#ea553a",
"クロムイエローchrome yellow" => "#fcc800",
"ピーコックグリーンpeacock green" => "#00a497",
"ヘリオトロープheliotrope" => "#9079b6",
"ピンクホワイトpink white" => "#fef9fb",
"スカーレットscarlet" => "#ea5532",
"クリームcream" => "#e3d7a3",
"ナイルブルーnile blue" => "#2cb4ad",
"ディープロイヤルパープルdeep royal purple" => "#47266e",
"ミルキーホワイトmilky white" => "#fffff9",
"キャロットオレンジcarrot orange" => "#ed6d35",
"ストローstraw" => "#ece093",
"サックスブルーsaxe blue" => "#418b89",
"グレープgrape" => "#56256e",
"アンバーホワイトamber white" => "#fff9f5",
"チャイニーズレッドchinese red" => "#ed6d46",
"ジャスミンイエローjasmine yellow" => "#edde7b",
"スレートグリーンslate green" => "#3c7170",
"モーブmauve" => "#915da3",
"ラベンダーアイスlavender ice" => "#f7f6fb",
"テラコッタterracotta" => "#bd6856",
"アンティックゴールドantique gold" => "#c1ab05",
"テールグリーンteal green" => "#006a6c",
"アイリスiris" => "#c7a5cc",
"パールホワイトpearl white" => "#f7f6f5",
"ココアブラウンcocoa brown" => "#98605e",
"オリーブolive" => "#72640c",
"アクアグリーンaqua green" => "#88bfbf",
"ライラックlilac" => "#d1bada",
"アイボリーivory" => "#f8f4e6",
"マホガニーmahogany" => "#6b3f31",
"オリーブドラブolive drab" => "#665a1a",
"アクアマリンaquamarine" => "#67b5b7",
"ラベンダーlavender" => "#cab8d9",
"パウダーピンクpowder pink" => "#f5ecf4",
"チョコレートchocolate" => "#6c3524",
"ジョンブリアンjaune brillant" => "#ffdc00",
"ピーコックブルーpeacock blue" => "#009e9f",
"クロッカスcrocus" => "#b79fcb",
"シルバーホワイトsilver white" => "#efefef",
"マルーンmarron" => "#6a1917",
"イエローyellow" => "#ffdc00",
"ターコイズturquoise" => "#009b9f",
"ラベンダーモーブlavender mauve" => "#a688bd",
"フロスティグレイfrosty gray" => "#e8ece9",
"セピアsepia" => "#622d18",
"シトラスcitrus" => "#eddc44",
"カプリブルーcapri blue" => "#00a3a7",
"パープルpurple" => "#9b72b0",
"シルバーピンクsilver pink" => "#eeeaec",
"コーヒー色coffee" => "#7b5544",
"ライムライトlimelight" => "#fff799",
"ケンブリッジブルーcambridge blue" => "#25b7c0",
"ロイヤルパープルroyal purple" => "#7f1184",
"ベージュカメオbeige cameo" => "#eee9e6",
"ブラウンbrown" => "#8f6552",
"カナリヤcanary yellow" => "#fff462",
"ターコイズブルーturquoise blue" => "#00afcc",
"レーズンraisin" => "#6b395f",
"エクリュecru" => "#eee7e0",
"バーントシェンナburnt sienna" => "#bb5535",
"ミモザmimosa" => "#fff462",
"ホライズンブルーhorizon blue" => "#82cddd",
"プラムplum" => "#6c2463",
"ピンクベージュpink beige" => "#ede4e1",
"アンバーローズamber rose" => "#e6bfb2",
"レモンイエローlemon yellow" => "#fff352",
"サマーシャワーsummer shower" => "#a1d8e2",
"ラズベリーraspberry" => "#841a75",
"フロスティホワイトfrosty white" => "#e6eae6",
"ベージュローゼbeige rose" => "#e8d3ca",
"メロンイエローmelon yellow" => "#e0de94",
"ホリゾンブルーhorizon blue" => "#a1d8e6",
"フランボワーズframboise" => "#9a0d7c",
"オイスターホワイトoyster white" => "#eae8e1",
"サーモンピンクsalmon pink" => "#f3a68c",
"シャルトルーズイエローchartreuse yellow" => "#e3e548",
"セルリアンブルーcerulean blue" => "#008db7",
"ダリアパープルdahlia purple" => "#a50082",
"ウィステリアミストwisteria mist" => "#d3d6dd",
"サハラsahara" => "#e29676",
"ライムイエローlime yellow" => "#eaeea2",
"ダックブルーduck blue" => "#007199",
"オーキッドパープルorchid purple" => "#af0082",
"クラウドcloud" => "#d4d9df",
"アッシュローズash rose" => "#e6bfab",
"ライムグリーンlime green" => "#e6eb94",
"マリンブルーmarine blue" => "#006888",
"ラズベリーレッドraspberry red" => "#9f166a",
"ムーングレイmoon gray" => "#d4d9dc",
"シェルピンクshell pink" => "#fbdac8",
"シャトルーズグリーンchartreuse green" => "#d9e367",
"マドンナブルーmadonna blue" => "#00608d",
"オーキッドorchid" => "#d9aacd",
"チャイナクレイchina clay" => "#d4dcd3",
"ベビーピンクbaby pink" => "#fdede4",
"レタスグリーンlettuce green" => "#d1de4c",
"エジプシャンブルーegyptian blue" => "#0073a8",
"リラlilla" => "#e0b5d3",
"サンドベージュsand beige" => "#dcd6d2",
"ネールピンクnail pink" => "#fce4d6",
"オリーブグリーンolive green" => "#5f6527",
"ベビーブルーbaby blue" => "#bbe2f1",
"ローズタンドルrose tendre" => "#e6afcf",
"オーキッドミストorchid mist" => "#d3d3d8",
"ローシェンナraw sienna" => "#e17b34",
"モスグリーンmoss green" => "#777e41",
"スカイブルーsky blue" => "#a0d8ef",
"オーキッドピンクorchid pink" => "#da81b2",
"リードグレイreed gray" => "#d4d9d6",
"キャラメルcaramel" => "#bc611e",
"グラスグリーンgrass green" => "#7b8d42",
"シャドウブルーshadow blue" => "#719bad",
"シクラメンピンクcyclamen pink" => "#d04f97",
"スカイグレイsky gray" => "#cbd0d3",
"サンセットsunset" => "#f6b483",
"スプリンググリーンspring green" => "#9cbb1c",
"シアンcyan" => "#00a1e9",
"マゼンタmagenta" => "#e4007f",
"ラベンダーグレイlavender gray" => "#bcbace",
"シナモンcinnamon" => "#be8f68",
"リーフグリーンleaf green" => "#9fc24d",
"ヨットブルーyacht blue" => "#409ecc",
"ブーゲンビリアbougainvillaea" => "#e62f8b",
"シルバーsilver" => "#c9caca",
"タンtan" => "#bf783e",
"ホワイトリリーwhite lily" => "#f0f6da",
"チョークブルーchalk blue" => "#68a9cf",
"ルビーruby" => "#c70067",
"パールグレイpearl gray" => "#c9c9c4",
"シャンパンchampagne" => "#e9dacb",
"アスパラガスグリーンasparagus green" => "#dbebc4",
"ピジョンブルーpigeon blue" => "#88b5d3",
"クラレットclaret" => "#941f57",
"サンドグレイsand gray" => "#c9c9c2",
"ピーチpeach" => "#fbd8b5",
"シトロングリーンcitron green" => "#618e34",
"スモークブルーsmoke blue" => "#a4c1d7",
"アザレazalee" => "#d83473",
"マーブルグレイmarble gray" => "#c0c5c2",
"カフェオレcafe au lait" => "#946c45",
"メドウグリーンmeadow green" => "#65ab31",
"フロスティブルーfrosty blue" => "#bbdbf3",
"コスモスcosmos" => "#dc6b9a",
"オパールグレイopal gray" => "#bfbec5",
"オレンジorange" => "#ee7800",
"アップルグリーンapple green" => "#a7d28d",
"ブルーアシードbleu acide" => "#006eb0",
"ロータスピンクlotus pink" => "#de82a7",
"フレンチグレイfrench gray" => "#8da0b6",
"アプリコットapricot" => "#f7b977",
"アイビーグリーンivy green" => "#578a3d",
"コバルトブルーcobalt blue" => "#0068b7",
"オールドオーキッドold orchid" => "#e3adc1",
"ミストmist" => "#b4aeb1",
"アンバーamber" => "#c2894b",
"スピナッチグリーンspinach green" => "#417038",
"サファイアブルーsapphire blue" => "#0068b7",
"ローズミストrose mist" => "#debecc",
"アッシュブロンドash blond" => "#b5b5ae",
"ブロンズbronze" => "#ac6b25",
"カクタスcactus" => "#387d39",
"スペクトラムブルーspectrum blue" => "#0075c2",
"ローズドラジェrose dragee" => "#e5c1cd",
"フォッグfog" => "#abb1b5",
"ヴァニラvanilla" => "#e8c59c",
"スカイグリーンsky green" => "#bee0c2",
"ブルーblue" => "#0075c2",
"チェリーピンクcherry pink" => "#eb6ea0",
"ベージュグレイbeige gray" => "#b4ada9",
"コルクcork" => "#c49a6a",
"スペアミントspearmint" => "#79c06e",
"ゼニスブルーzenith blue" => "#4496d3",
"オペラopera" => "#e95388",
"シルバーグレイsilver gray" => "#afafb0",
"バーントアンバーburnt umber" => "#6f5436",
"ミントグリーンmint green" => "#89c997",
"ヘブンリーブルーheavenly blue" => "#68a4d9",
"ローズレッドrose red" => "#ea618e",
"ストームグレイstorm gray" => "#aaaab0",
"ローアンバーraw umber" => "#866629",
"パロットグリーンparrot green" => "#37a34a",
"オーキッドグレイorchid gray" => "#bcc7d7",
"オールドライラックold lilac" => "#b0778c",
"グリーンフォッグgreen fog" => "#abb1ad",
"フレッシュflesh" => "#fad09e",
"サマーグリーンsummer green" => "#009944",
"パウダーブルーpowder blue" => "#bccddb",
"ココア色cocoa" => "#6e4a55",
"アッシュグレイash gray" => "#9fa09e",
"ゴールデンイエローgolden yellow" => "#f6ae54",
"オパールグリーンopal green" => "#bee0ce",
"ライトブルーlight blue" => "#b2cbe4",
"ワインレッドwine red" => "#b33e5c",
"ローズグレイrose gray" => "#9d8e87",
"マンダリンオレンジmandarin orange" => "#f3981d",
"スプレイグリーンspray green" => "#a4d5bd",
"ベイビーブルーbaby blue" => "#a2c2e6",
"ガーネットgarnet" => "#942343",
"エレファントスキンelephant skin" => "#9f9f98",
"マリーゴールドmarigold" => "#f39800",
"ボトルグリーンbottle green" => "#004d25",
"デイドリームday dream" => "#a3b9e0",
"コチニールレッドcochineal red" => "#c82c55",
"バトルシップグレイbattleship gray" => "#898989",
"エクルベージュecru beige" => "#f6e5cc",
"コバルトグリーンcobalt green" => "#3cb37a",
"サルビアブルーsalvia blue" => "#94adda",
"ストロベリーstrawberry" => "#e73562",
"ストーングレイstone gray" => "#898880",
"オイスターoyster" => "#eae1cf",
"エバーグリーンevergreen" => "#00984f",
"ヒヤシンスブルーhyacinth blue" => "#7a99cf",
"ルビーレッドruby red" => "#e73562",
"モスグレイmoss gray" => "#7e837f",
"オーカーochre" => "#ba8b40",
"マラカイトグリーンmalachite green" => "#009854",
"ヒヤシンスhyacinth" => "#6c9bd2",
"カーマインcarmine" => "#d70035",
"ダブグレイdove gray" => "#7d7b83",
"カーキーkhaki" => "#c5a05a",
"グリーンgreen" => "#00a960",
"ミッドナイトブルーmidnight blue" => "#001e43",
"シグナルレッドsignal red" => "#e8383d",
"グレイgray" => "#7d7d7d",
"バフbuff" => "#caac71",
"エメラルドグリーンemerald green" => "#00a968",
"ネービーブルーnavy blue" => "#202f55",
"バーガンディーburgundy" => "#6c2735",
"スチールグレイsteel gray" => "#736d71",
"サフランイエローsaffron yellow" => "#fac559",
"フォレストグリーンforest green" => "#288c66",
"プルシャンブルーprussian blue" => "#192f60",
"ボルドーbordeaux" => "#6c272d",
"アイビーグレイivy gray" => "#666c67",
"パンプキンpumpkin" => "#e5a323",
"ビリジアンviridian" => "#00885a",
"アイアンブルーiron blue" => "#192f60",
"カメリアcamellia" => "#da536e",
"スレートグレイslate gray" => "#626063",
"イエローオーカーyellow ocher" => "#c4972f",
"ホーリーグリーンholly green" => "#006948",
"インディゴindigo" => "#043c78",
"ローズrose" => "#e95464",
"グラファイトgraphite" => "#594e52",
"ブロンドblond" => "#f2d58a",
"ビリヤードグリーンbilliard green" => "#005c42",
"インクブルーink blue" => "#003f8e",
"ローズピンクrose pink" => "#f19ca7",
"チャコールグレイcharcoal gray" => "#4e454a",
"ベージュbeige" => "#eedcb3",
"クロムグリーンchrome green" => "#00533f",
"オリエンタルブルーoriental blue" => "#26499d",
"ピンクpink" => "#f5b2b2",
"トープtaupe" => "#504946",
"ビスケットbiscuit" => "#ead7a4",
"アンティークグリーンantique green" => "#54917f",
"ウルトラマリンブルーultramarine blue" => "#4753a2",
"フラミンゴピンクflamingo pink" => "#f5b2ac",
"ランプブラックlamp black" => "#24140e",
"レグホーンleghorn" => "#ffe9a9",
"ウォーターグリーンwater green" => "#a5c9c1",
"ウルトラマリンultramarine" => "#434da2",
"オールドローズold rose" => "#e29399",
"ブラックblack" => "#000000"
}
end
end
template :layout do
"<html><body style="background-color: #000000; line-height: 1.6"><%= yield %></body></html>"
end
get '/' do
erb :index
end
__END__
@@index
<div>
<% colors.each do |k, v| %>
<span style="color:<%= v %>">サンプルテキスト <%= k %>  <%= v %></span><br>
<% end %>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment