-

カラーパレットジェネレーター

提供:Hidezumi's Mediawiki
2022年1月2日 (日) 06:51時点におけるHidezumi (トーク | 投稿記録)による版 (1版 をインポートしました)
(差分) ← 古い版 | 最新版 (差分) | 新しい版 → (差分)
ナビゲーションに移動 検索に移動
<?php
include_once("colors.inc.php"); 
include_once("rgb2hsv.inc"); 
?>

<html>
<head>
<title>Color pallette Generator</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" href="jquery-ui-1/development-bundle/themes/base/jquery.ui.all.css">
<script src="jquery-ui-1/development-bundle/jquery-1.6.2.js"></script>
<script src="jquery-ui-1/development-bundle/ui/jquery.ui.position.js"></script>
<script src="jquery-ui-1/development-bundle/ui/jquery.ui.core.js"></script>
<script src="jquery-ui-1/development-bundle/ui/jquery.ui.widget.js"></script>
<script src="jquery-ui-1/development-bundle/ui/jquery.ui.mouse.js"></script>
<script src="jquery-ui-1/development-bundle/ui/jquery.ui.draggable.js"></script>
<script src="jquery-ui-1/development-bundle/ui/jquery.ui.droppable.js"></script>
<script src="jquery-ui-1/development-bundle/ui/jquery.ui.resizable.js"></script>
<script src="jquery-ui-1/development-bundle/ui/jquery.ui.dialog.js"></script>
<script src="jquery-ui-1/development-bundle/ui/jquery.ui.sortable.js"></script>
<script src="new.js"></script>
</head>
<body>
<center>
<article>

<div id="photo">
<?php 
if($photo){
$ex=new GetMostCommonColors(); 
$ex->image=$id; 
$colors=$ex->Get_Color(); 
asort($colors);

$colors_to_show = 50;
$pal = new GetMostCommonColors();
$pal->image = $id;
$colors =$pal->Get_Color();
$colors_key = array_keys($colors);

$inc = sqrt($colors_to_show);

for ($i = 0; $i < $colors_to_show; $i += $inc) {
	$out = "<tr style=\"margin: 0; padding: 0;\">";
 
    for($j=0;$j<$inc;$j++) {
        $out .= "<td class=\"draggable\" style=\"width: 20px; height: 20px; margin: 0; padding: 0\" title=\"#".$colors_key[$i + $j]."\" 
                 bgcolor=\"#".$colors_key[$i + $j]."\"></td>";
    }
    $out .= "</tr>";
    echo $out;
}
echo "</table>";


}
?>
</div>
<?php
if($photo){
list($width, $height) = getimagesize($id);
$ratio = $width/180;
$height = $height/$ratio;
echo "<img class=\"mainphoto\" width=\"180\" heigth=\"$height\" src=\"$id\">";
}
?>
</div>
</article>
<aside>
<h2>簡単な使い方</h2>
<h3>パレットの取得</h3>
写真のURLをフォームに入れてsubmitを押すと写真の中からよく使われている色を抽出します。パレットをPantsと書かれている枠に入れると、人形のパンツの色が変わります。Safari5.xとGoogle Chromeで動作確認しました。iPadなどのタブレット端末では動きません。
<p><a href="http://www.omnioo.com/record/php/color_extract_php_class/">カラーパレットの抽出についてはコチラ。</a>
<h3>編集</h3>
<p>できあがったパレットは[プリント] - [PDF]で保存することができます。(マッキントッシュの場合)<p>PDFをIllustratorなどで開くとパレットや人形を編集することも可能です。

</aside>
</center>
<footer>
© 2014 Creative Mind Consulting
</footer>
</body>
</html>