Glitch City Laboratories Archives

Glitch City Laboratories closed on 1 September 2020 (announcement). This is an archived copy of a thread from Glitch City Laboratories Forums.

You can join Glitch City Research Institute to ask questions or discuss current developments.

You may also download the archive of this forum in .tar.gz, .sql.gz, or .sqlite.gz formats.

Programming/Scripting/Development/Web Design

Gradient (mIRC Script) - Page 1

Gradient (mIRC Script)

Posted by: PichuUmbreon
Date: 2008-12-26 21:56:28
Made a new mIRC script that gradient-izes text you put in and outputs it to a text file. Anybody can port it to another language if they want.

Yes, it was made specifically for forums that support BB code, like this one.

Syntax is: /gradient <leftmost color> <rightmost color> <text>

gradient {
  var %red-1 $base($mid($1,1,2),16,10)
  var %green-1 $base($mid($1,3,2),16,10)
  var %blue-1 $base($mid($1,5,2),16,10)
  var %red-2 $base($mid($2,1,2),16,10)
  var %green-2 $base($mid($2,3,2),16,10)
  var %blue-2 $base($mid($2,5,2),16,10)
  var %red-g $calc($calc(%red-2 - %red-1) / $len($3-))
  var %green-g $calc($calc(%green-2 - %green-1) / $len($3-))
  var %blue-g $calc($calc(%blue-2 - %blue-1) / $len($3-))
  var %chr 1
  while %chr <= $len($3-) {
    var %output %output $+ $+ $mid($3-,%chr,1) $+
    var %red-1 $calc(%red-1 + %red-g)
    var %green-1 $calc(%green-1 + %green-g)
    var %blue-1 $calc(%blue-1 + %blue-g)
    inc %chr
  }
  write -c gradient.txt %output
}