ID:171102
 
Heyo, I'm just verifying...

If I do, for example;

usr.icon=rgb(255,0,0)

That, is different from, say;

usr.icon+=rgb(255,0,0)


Correct? Thanks.
No.
255 is the max, so there's really no difference.
Unless you have green and blue within it.
In response to Hell Ramen
Well, I'm using 255 as an example, I mean, in general, is there a difference? Does = just make the RGB that and += add to the current RGB?
In response to FireEmblem
FireEmblem wrote:
Well, I'm using 255 as an example, I mean, in general, is there a difference? Does = just make the RGB that and += add to the current RGB?

I think...
[Edit]I think you can only use += only. ;o
In response to FireEmblem
FireEmblem wrote:
Well, I'm using 255 as an example, I mean, in general, is there a difference? Does = just make the RGB that and += add to the current RGB?

Correct. Setting an icon to a colour will make it a solid block of that colour. Adding the colour to the icon will just tint the icon.
In response to Crispy
Crispy wrote:
FireEmblem wrote:
Well, I'm using 255 as an example, I mean, in general, is there a difference? Does = just make the RGB that and += add to the current RGB?

Correct. Setting an icon to a colour will make it a solid block of that colour. Adding the colour to the icon will just tint the icon.

Is there anyway to return an icon to it's normal state of color with using RGB?
In response to Hell Ramen
Sort of. You can try doing the reverse operations that you just did, but you'll usually end up with some information being lost. For example:

icon += rgb(255,0,0)
icon -= rgb(255,0,0)


That will result in all the red being removed from the icon, because it's capped at 255.

It's far better to keep a copy of the original icon and set it back to that.

Alternatively, you can use the handy initial() proc. This only works if the icon was originally set at compile time, though.

mob/player
icon='player.dmi'
verb/MakeMeRed()
icon+=rgb(32,0,0)
verb/ResetIcon()
icon=initial(icon)
In response to Crispy
Ahh, thanks Crispy. :D
It's always fun to make potions turn you red...
In response to Hell Ramen
Yes, yes it is. =)

That would be cool... a game where using a potion too much would tint your character different colours... =P Though I'd use multiplication rather than addition, or the icons would get very messed up. You'd have to do the colour adding in moderation, too.