Cecho issue

Patek
Posts: 8
Joined: Fri May 21, 2010 9:16 pm

Re: Cecho issue

Post by Patek »

Looks like I ran into this with 'd' by itself as well. But not always?

Theoretically, these two should be more or less the same - with the first being a horizontal line fading from green to purple, and the second being vertical:
Code: [show] | [select all] lua
cecho("\n<white:black><black:green> a ")
cecho("<white:black><black:lawn_green> b ")
cecho("<white:black><black:green_yellow> c ")
cecho("<white:black><black:yellow> d ")
cecho("<white:black><black:gold> e ")
cecho("<white:black><black:orange> f ")
cecho("<white:black><black:orange_red> g ")
cecho("<white:black><black:red> h ")
cecho("<white:black><black:violet_red> i ")
cecho("<white:black><black:purple> l ")
cecho("<white:black><black:dark_violet> k ")

cecho("\n<white:black><black:green> a ")
cecho("\n<white:black><black:lawn_green> b ")
cecho("\n<white:black><black:green_yellow> c ")
cecho("\n<white:black><black:yellow> d ")
cecho("\n<white:black><black:gold> e ")
cecho("\n<white:black><black:orange> f ")
cecho("\n<white:black><black:orange_red> g ")
cecho("\n<white:black><black:red> h ")
cecho("\n<white:black><black:violet_red> i ")
cecho("\n<white:black><black:purple> l ")
cecho("\n<white:black><black:dark_violet> k ")
The second bit (vertical, newlines between each) works just fine. The first bit, 'd'-'h' are all shown as the same color, yellow.'i'-'k' are displayed correctly, 'a'-'d' are displayed correctly. 'e'-'h' aren't getting the colors applied.

Has this been fixed since 1.1.0? (That might still be the current version, haven't checked, but I'm reticent to upgrade something which is otherwise working)

Denarii
Posts: 111
Joined: Thu Dec 03, 2009 10:54 pm

Re: Cecho issue

Post by Denarii »

Huh. That's a weird one.

Denarii
Posts: 111
Joined: Thu Dec 03, 2009 10:54 pm

Re: Cecho issue

Post by Denarii »

It looks like it's not a cecho issue. Mudlet appears to be throttling style changes within a single line, as far as I can tell.

Patek
Posts: 8
Joined: Fri May 21, 2010 9:16 pm

Re: Cecho issue

Post by Patek »

That's not it (throttling)... consider the following:
Code: [show] | [select all] lua
cecho("\n<black:green>  ")
cecho("<black:lawn_green>  ")
cecho("<black:green_yellow>  ")
--cecho("<black:yellow>  ")
--cecho("<black:gold>  ")
--cecho("<black:orange>  ")
--cecho("<black:orange_red>  ")
cecho("<black:red>  ")
cecho("<black:violet_red>  ")
cecho("<black:purple>  ")
cecho("<black:dark_violet>  ")
cecho("<black:violet_red>  ")
cecho("<black:purple>  ")
cecho("<black:dark_violet>  ")
cecho("<black:violet_red>  ")
cecho("<black:purple>  ")
cecho("<black:dark_violet>  ")
That displays just fine. That's 13 color changes on a single line. However:
Code: [show] | [select all] lua
cecho("\n<black:green>  ")
cecho("<black:lawn_green>  ")
cecho("<black:green_yellow>  ")
cecho("<black:yellow>  ")
cecho("<black:red>  ")
cecho("<black:violet_red>  ")
cecho("<black:purple>  ")
cecho("<black:dark_violet>  ")
... Just eight changes, but the red set of spaces shows up as yellow. Note that this also removes the single-letter string from the equation.

Denarii
Posts: 111
Joined: Thu Dec 03, 2009 10:54 pm

Re: Cecho issue

Post by Denarii »

You're right. Even weirder, this seems to happen only when you use colors in the red-yellow spectrum. It's definitely not cecho, though. It's something in Mudlet itself. The same thing happens when you do this:
Code: [show] | [select all] lua
local r, g, b = unpack(color_table.green)
setFgColor(0, 0, 0)
setBgColor(r, g, b)
echo"   "
resetFormat()
r, g, b = unpack(color_table.lawn_green)
setFgColor(0, 0, 0)
setBgColor(r, g, b)
echo"   "
resetFormat()
r, g, b = unpack(color_table.green_yellow)
setFgColor(0, 0, 0)
setBgColor(r, g, b)
echo"   "
resetFormat()
r, g, b = unpack(color_table.yellow)
setFgColor(0, 0, 0)
setBgColor(r, g, b)
echo"   "
resetFormat()
r, g, b = unpack(color_table.gold)
setFgColor(0, 0, 0)
setBgColor(r, g, b)
echo"   "
resetFormat()
r, g, b = unpack(color_table.orange)
setFgColor(0, 0, 0)
setBgColor(r, g, b)
echo"   "
resetFormat()
r, g, b = unpack(color_table.orange_red)
setFgColor(0, 0, 0)
setBgColor(r, g, b)
echo"   "
resetFormat()
r, g, b = unpack(color_table.red)
setFgColor(0, 0, 0)
setBgColor(r, g, b)
echo"   "
resetFormat()
r, g, b = unpack(color_table.violet_red)
setFgColor(0, 0, 0)
setBgColor(r, g, b)
echo"   "
resetFormat()
r, g, b = unpack(color_table.purple)
setFgColor(0, 0, 0)
setBgColor(r, g, b)
echo"   "
resetFormat()
r, g, b = unpack(color_table.dark_violet)
setFgColor(0, 0, 0)
setBgColor(r, g, b)
echo"   "
resetFormat()
r, g, b = unpack(color_table.violet_red)
setFgColor(0, 0, 0)
setBgColor(r, g, b)
echo"   "
resetFormat()
r, g, b = unpack(color_table.purple)
setFgColor(0, 0, 0)
setBgColor(r, g, b)
echo"   "
resetFormat()
r, g, b = unpack(color_table.dark_violet)
setFgColor(0, 0, 0)
setBgColor(r, g, b)
echo"   "
resetFormat()
r, g, b = unpack(color_table.violet_red)
setFgColor(0, 0, 0)
setBgColor(r, g, b)
echo"   "
resetFormat()
r, g, b = unpack(color_table.purple)
setFgColor(0, 0, 0)
setBgColor(r, g, b)
echo"   "
resetFormat()

User avatar
Heiko
Site Admin
Posts: 1548
Joined: Wed Mar 11, 2009 6:26 pm

Re: Cecho issue

Post by Heiko »

I might not get the problem correctly, but if I use setBgColor() directly it looks alright:
Code: [show] | [select all] lua
--cecho("<black:red>  ")
setBgColor(255,0,0)
echo("  ")
--cecho("<black:violet_red>  ")
setBgColor(150,0,150)
echo("  ")
--cecho("<black:purple>  ")
setBgColor(90,0,90)
echo("  ")
--cecho("<black:dark_violet>d  ")

Denarii
Posts: 111
Joined: Thu Dec 03, 2009 10:54 pm

Re: Cecho issue

Post by Denarii »

Try the one I posted that uses setBgColor directly and you'll see the problem.

User avatar
Heiko
Site Admin
Posts: 1548
Joined: Wed Mar 11, 2009 6:26 pm

Re: Cecho issue

Post by Heiko »

Well, obviously color_table doesn't hold the correct values somehow as it seems to work if I use numeric values.

Patek
Posts: 8
Joined: Fri May 21, 2010 9:16 pm

Re: Cecho issue

Post by Patek »

Contents of those colors:
green_yellow: 173:255:47
yellow: 255:255:0
gold: 255:215:0
orange: 255:165:0
orange_red: 255:69:0
red: 255:0:0

Looks okay. So it's not color_table.

User avatar
Heiko
Site Admin
Posts: 1548
Joined: Wed Mar 11, 2009 6:26 pm

Re: Cecho issue

Post by Heiko »

It's a Mudlet bug. Some correct rgb values are not accepted. This, for example, works fine:
Code: [show] | [select all] lua
setFgColor(1, 1, 1)
setBgColor(255, 255, 1)
echo" a "

setBgColor(254, 215, 1)
echo" b "

setFgColor(1, 1, 1)
setBgColor(255, 165, 1)
echo" c "

setBgColor(254, 69, 1)
echo" d "

setFgColor(1, 1, 1)
setBgColor(255, 1, 1)
echo" e "

setFgColor(1, 1, 1)
setBgColor(150, 1, 150)
echo" f "

Post Reply