formatting_settings.txt

Know of something that might be useful to the DC community? Post it here! (Still, no advertising)

Moderator: Moderators

Locked
Marooned
Posts: 1
Joined: 2005-10-06 19:47

formatting_settings.txt

Post by Marooned » 2005-10-06 19:52

In the scripts folder, there is a formatting_settings.txt file.

This file will allow you to change the foreground colors of dc++ upon entering a hub.

Does anyone know what all of the usable colors are? I'm trying to find a list and am unsuccessfully found anything.

Thank you

Marooned

Xan1977
Forum Moderator
Posts: 627
Joined: 2003-06-05 20:15

Post by Xan1977 » 2005-10-06 21:07

LUA support is not a feature of DC++, which is why the topic was moved.

The colors are defined in formatting.lua

Code: Select all

-- color conversion types
formatting.color_conversion = {}
formatting.color_conversion.black	= {0, 0, 0}
formatting.color_conversion.white	= {255, 255, 255}
formatting.color_conversion.gray	= {127, 127, 127}
formatting.color_conversion.red		= {255, 0, 0}
formatting.color_conversion.green	= {0, 255, 0}
formatting.color_conversion.blue	= {0, 0, 255}
formatting.color_conversion.yellow	= {255, 255, 0}
formatting.color_conversion.magenta	= {255, 0, 255}
formatting.color_conversion.cyan	= {0, 255, 255}
-- dark variants
formatting.color_conversion.darkgray	= {63, 63, 63}
formatting.color_conversion.darkred		= {127, 0, 0}
formatting.color_conversion.darkgreen	= {0, 127, 0}
formatting.color_conversion.darkblue	= {0, 0, 127}
formatting.color_conversion.darkyellow	= {127, 127, 0}
formatting.color_conversion.darkmagenta	= {127, 0, 127}
formatting.color_conversion.darkcyan	= {0, 127, 127}
-- aliases
formatting.color_conversion.brown		= formatting.color_conversion.darkyellow
formatting.color_conversion.grey		= formatting.color_conversion.gray
formatting.color_conversion.darkgrey	= formatting.color_conversion.darkgray
formatting.color_conversion.lightgrey  = formatting.color_conversion.lightgray

-- convert colors..
function formatting.setColors()
	formatting.color = {}
	for k,v in formatting_opt.color do
		if formatting.color_conversion[v] then
			local c = formatting.color_conversion[v]
			formatting.color[k] = "\\red"..c[1].."\\green"..c[2].."\\blue"..c[3]..";"
		else
			formatting.color[k] = v
		end
		-- optionally invert color
		if formatting.background_is_dark then
			local ret,c,r,g,b = string.find( formatting.color[k], "^\\red(%d+)\\green(%d+)\\blue(%d+);$" )
			if ret then
				formatting.color[k] = "\\red"..(255-tonumber(r))..
										"\\green"..(255-tonumber(g))..
										"\\blue"..(255-tonumber(b))..";"
			end
		end
	end
end
As you see, you could redefine them or add more, if you'd like. :)

Carraya
Posts: 112
Joined: 2004-09-21 11:43

Post by Carraya » 2005-10-07 01:50

Basicly all you need to do to add exactly the color you want is to put the RGB code into a new line and call it something...
<random funny comment>

Locked