Topic: e621 gradient text tool

Posted under e621 Tools and Applications

1. Copy this code:

<html><head><title>Color Text</title><style>
.hexagon {background:#152F56;color:#FFFFFF;}
.pony {background:#2F175C;color:#FFFFFF;}
.bloodlust {background:#222222;color:#FFFFFF;}
.serpent {background:#85FF85;color:#000000;}
.clean {background:#152F56;color:#FFFFFF;}
.hotdog {background:#FF0000;color:#000000;}
#prvtxt {border-radius:4px;box-shadow:2px 2px 5px #07162D;font-family:verdana,sans-serif;font-size:82%;padding:10px;}
.hexagon #prvtxt {background:#213A5F}
.pony #prvtxt {background:#3A2364}
.bloodlust #prvtxt {background:#2D2D2D}
.serpent #prvtxt {background:#8BFF8B}
.clean #prvtxt {background:#213A5F;font-family:arial;}
.hotdog #prvtxt {background:#FFFF00}
.bold {font-weight:bold;}
</style><script>
var grads = [];

grads[0] = [];
grads[1] = [[0,255,64,0],[0.5,255,255,0],[1,255,64,0]];
grads[2] = [[0,255,64,0],[0.2,255,128,0],[0.4,255,255,0],[0.6,0,255,0],[0.8,0,192,255],[1,255,0,255]];
grads[3] = [[0,255,255,255],[0.125,128,128,128],[0.25,255,255,255],[0.375,128,128,128],[0.5,255,255,255],[0.625,128,128,128],[0.75,255,255,255],[0.875,128,128,128],[1,255,255,255]];
grads[4] = [[0,0,160,0],[0.2,0,255,0],[0.4,0,160,0],[0.6,0,255,0],[0.8,0,160,0],[1,0,255,0]];
grads[5] = [[0,0,160,0],[0.1,0,255,0],[0.2,0,160,0],[0.3,0,255,0],[0.4,0,160,0],[0.5,0,255,0],[0.6,0,160,0],[0.7,0,255,0],[0.8,0,160,0],[0.9,0,255,0],[1,0,160,0]];
grads[6] = [[0,0,255,255],[0.125,0,128,255],[0.25,0,255,255],[0.375,0,128,255],[0.5,0,255,255],[0.625,0,128,255],[0.75,0,255,255],[0.875,0,128,255],[1,0,255,255]];

function $(i) {return document.getElementById(i)}
function p(s) {if(s.length==1) {return "0"+s;} return s;}
function color()
{
	$("bbtxt").value="";
	if($("bolded").checked==true){$("prvtxt").className="bold";}else{$("prvtxt").className="";}
	var g=$("grad").selectedIndex;if(g==0){$("prvtxt").innerHTML=$("txtin").value;return;}
	if($("bolded").checked==true){$("bbtxt").value+="[b]";}
	$("prvtxt").innerHTML="";var tx=$("txtin").value;
	var l=tx.replace(/\s/gi,"").length;
	for (var x=0, y=0; x<l; x++)
	{
		while (tx.substr(x+y,1)==" ") {y++;$("prvtxt").innerHTML+=" ";$("bbtxt").value+=" ";}
		var pos = x/l;
		for (var i=0;i<grads[g].length-1;i++) {if(pos<grads[g][i+1][0]){break;}}
		var pct1=1-((pos-grads[g][i][0])/(grads[g][i+1][0]-grads[g][i][0]));var pct2=((pos-grads[g][i][0])/(grads[g][i+1][0]-grads[g][i][0]));
		var red=Math.round((pct1*grads[g][i][1])+(pct2*grads[g][i+1][1]));
		var grn=Math.round((pct1*grads[g][i][2])+(pct2*grads[g][i+1][2]));
		var blu=Math.round((pct1*grads[g][i][3])+(pct2*grads[g][i+1][3]));
		var rgb="#"+p(red.toString(16))+p(grn.toString(16))+p(blu.toString(16));
		$("prvtxt").innerHTML+="<span style='color:"+rgb+";'>"+tx.substr(x+y,1)+"</span>";
		$("bbtxt").value+="[color="+rgb+"]"+tx.substr(x+y,1)+"[/color]";
	}
	if($("bolded").checked==true){$("bbtxt").value+="[/b]";}
}
</script></head><body onload="$('txtin').value='Your text goes here.';$('bbtxt').value='';$('grad').selectedIndex=0;$('theme').selectedIndex=0" class="hexagon">
<textarea id="txtin" cols="80" rows="7">Your text goes here.</textarea><p><select id="grad" onchange="color()">
<option>None</option>
<option>Fire</option>
<option>Rainbow</option>
<option>Chalk</option>
<option>Dank</option>
<option>Dank2</option>
<option>Ocean</option>
</select>&nbsp;<select id="theme" onchange="document.body.className=this.value;"><option value="hexagon" selected="selected">Hexagon</option>
<option value="pony">Pony</option>
<option value="bloodlust">Bloodlust</option>
<option value="serpent">Serpent</option>
<option value="clean">Hexagon Clean</option>
<option value="hotdog">Hotdog</option>
</select>&nbsp;Bold?&nbsp;<input id="bolded" type="checkbox" checked="checked" onchange="color()"><input type="button" value="Color" onclick="color()">
</p><p id="prvtxt" class="bold">Your text goes here.</p><textarea id="bbtxt" cols="80" rows="7" onclick="this.select()"></textarea></body></html>

2. Paste into Notepad and save as "anything.html" without quotes.
3. Open in web browser.

How to make your own gradients

1. Add a new line:

grads[7] = [[0,255,64,0],[0.5,255,255,0],[1,255,64,0]];

2. Each point has 4 numbers. First number is a position between 0 and 1. Second number is red from 0-255. Third number is green from 0-255. Fourth number is blue from 0-255.

[0,255,64,0] // light red at 0%
[0.5,255,255,0] // yellow at 50%
[1,255,64,0] // light red at 100%

Start at position 0, end at position 1.

3. Add a new line to the first dropdown:

<option>Name</option>

For more about DText formatting:
For more about DText formatting:
For more about DText formatting:

https://e621.net/help/dtext

(USER WAS BANNED FOR THIS POST)

Updated

EmoCat said:
Kinda worried about 'USER BANNED FOR THIS POST', but cool!

It was a joke statement, don't worry. No one was banned over this. =)

Though the color gradients will probably only work on accounts that are privileged and above because member accounts can't use color Dtext. But for those who can use color text, it is pretty cool to make gradients from it. (And hopefully they'll remember to use it responsibly).

Updated by anonymous

furrypickle said:
Though the color gradients will probably only work on accounts that are privileged and above because member accounts can't use color Dtext.

Unless they're creating sets :)

You can use \[color] tags on a set's description

Updated by anonymous

Great, now people will get to be more obnoxious.

Updated by anonymous

Hudson

Former Staff

Mutisija said:
only users who are ranked priviliged and above can use colors :^)

Is there a limit of colors allowed? When you're priv+, can you just use the red color for the rest of your existence on e621 (only an example)?

Updated by anonymous

HotUnderTheCollar said:
Which sucks...

By the way, is there a limit of colors allowed? When you're priv+, can you just use the red color for the rest of your existence on e621 (only an example)?

i dont believe that theres any limits. i mean admins might get annoyed and slap for it but otherwise theres no limits. its no dofferent from bolding text.

Updated by anonymous

HotUnderTheCollar said:
By the way, is there a limit of colors allowed? When you're priv+, can you just use the red color for the rest of your existence on e621 (only an example)?

I don't think so. Afaik, you can use the whole possible color spectrum (16 million colors) provided as either HTML Color (#0088AA for ) or a Named Color (like lime for ). For color names reference, look here

Unless you mean like some comments I've seen (on FA) that use such colors, like Aqua or Yellow or those that can blend with the background

Updated by anonymous

Esme_Belles said:
Never understood why the colors was a privileged feature.

My guess is that they are useful in the forums to organize or illustrate things, but having a lot of users write in purple because they like purple or just want to stand out is generally annoying, and bordering on a usability issue.

That's my guess anyways.

Updated by anonymous

Mutisija said:
only users who are ranked priviliged and above can use colors :^)

thanks, but how would one go about attaining such a rank?

Updated by anonymous

  • 1