xFabel

Question:: unpack color HEX

Recommended Posts

i want to ask how i should extract colors from the server to client i used

						local r,g,b = unpack(enemy_color)

for client and this worked with tocolor(....255) so how to use it like #FFFFFF?

my trying

Quote

local colours = unpack(enemy_color)
dxDrawText("Team Name:"..colours..enemy_team..", 450,40,64,20,tocolor(255,255,255,255),1.00,"default-bold","center","center",false)

 

Edited by xFabel

Share this post


Link to post
5 minutes ago, Rut said:

i know but i wanna set team vs team that's what i want :(

example:

dxDrawText("Players: [#060660"..team_home.."/"..colorenemy..team_enemy.."], etc. . . . .

 

Edited by xFabel

Share this post


Link to post
function RGBToHex(red, green, blue, alpha)
	if((red < 0 or red > 255 or green < 0 or green > 255 or blue < 0 or blue > 255) or (alpha and (alpha < 0 or alpha > 255))) then return nil end
	if(alpha) then return string.format("#%.2X%.2X%.2X%.2X", red,green,blue,alpha)
	else return string.format("#%.2X%.2X%.2X", red,green,blue) end
end


dxDrawText(RGBToHex(getTeamColor(getTeamFromName("Police"))).."Police", 450,40,64,20,tocolor(255,255,255,255),1.00,"default-bold","center","center", nil, nil, nil, true)

 

  • Like 1

Share this post


Link to post
2 minutes ago, alexaxel705 said:

function RGBToHex(red, green, blue, alpha)
	if((red < 0 or red > 255 or green < 0 or green > 255 or blue < 0 or blue > 255) or (alpha and (alpha < 0 or alpha > 255))) then return nil end
	if(alpha) then return string.format("#%.2X%.2X%.2X%.2X", red,green,blue,alpha)
	else return string.format("#%.2X%.2X%.2X", red,green,blue) end
end


dxDrawText(RGBToHex(getTeamColor(getTeamFromName("Police"))).."Police", 450,40,64,20,tocolor(255,255,255,255),1.00,"default-bold","center","center", nil, nil, nil, true)

 

thank youuu ❤️

 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.