aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Pouar <thepouar@gmail.com>2017-02-18 19:00:34 -0600
committerGravatar Pouar <thepouar@gmail.com>2017-02-18 19:00:34 -0600
commitaca291b7ece3eddd1e3cda41087dd721458d5d8f (patch)
tree4a621d20fd18f88cc86c64d383e7cf3ebfdbd1ca
parentneeds to be at least 3 digits (diff)
got that working
-rw-r--r--identifur.php12
1 files changed, 6 insertions, 6 deletions
diff --git a/identifur.php b/identifur.php
index d326804..ae1e622 100644
--- a/identifur.php
+++ b/identifur.php
@@ -21,12 +21,12 @@ else
{
$newheight= (float)$_GET["height"];
}
-$rgb1=dechex(($hash >> 20) & 0xfff);
-$rgb2=dechex(($hash >> 8) & 0xfff);
-$tail=dechex(($hash >> 6) & 0b11);
-$ears=dechex(($hash >> 4) & 0b11);
-$wings=dechex(($hash >> 2) & 0b11);
-$clothes=dechex($hash & 0b11);
+$rgb1=sprintf("%03x",(($hash >> 20) & 0xfff));
+$rgb2=sprintf("%03x",(($hash >> 8) & 0xfff));
+$tail=sprintf("%03x",(($hash >> 6) & 0b11));
+$ears=sprintf("%03x",(($hash >> 4) & 0b11));
+$wings=sprintf("%03x",(($hash >> 2) & 0b11));
+$clothes=sprintf("%03x",($hash & 0b11));
$tailpaths[0]=<<<EOT
<path d="m125.67708 169.622c-21.68755-17.39448-45.257138-13.91836-62.744046 4.91369 15.179415 27.56736 46.724746 15.03834 62.589456 6.11444z" fill="#{$rgb1}" fill-rule="evenodd" stroke="#{$rgb1}" stroke-width=".26458332"/>
EOT;