# 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

Previous Page

- 1

Next Page

#### Gradient (mIRC Script)

Posted by: PichuUmbreon
Date: 2008-12-26 21:56:28
M a d e a n e w m I R C s c r i p t t h a t g r a d i e n t-i z e s t e x t y o u p u t i n a n d o u t p u t s i t t o a t e x t f i l e. A n y b o d y c a n p o r t i t t o a n o t h e r l a n g u a g e i f t h e y w a n t.
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
}
Previous Page

- 1

Next Page