Search
 
SCRIPT & CODE EXAMPLE
 

LUA

rgb to hex lua

-- assumes decimal values of r, g and b but can be easily retrofitted
function rgb_to_hex(r, g, b)
    --%02x: 0 means replace " "s with "0"s, 2 is width, x means hex
	return string.format("#%02x%02x%02x", 
		math.floor(r*255),
		math.floor(g*255),
		math.floor(b*255))
end

rgb_to_hex(0.01, 0.3, 0.1)
-- returns #024c19
Comment

PREVIOUS NEXT
Code Example
Lua :: roblox how to make debounce 
Lua :: luau how to loop through all players 
Lua :: roblox tween 
Lua :: lua wrap number 
Lua :: roblox lua gui drag 
Lua :: conda find package version 
Lua :: roblox random part color 
Lua :: creating new functions using script roblox 
Lua :: roblox rotate model 
Lua :: lua event 
Lua :: lua infinite 
Lua :: change material roblox lua 
Lua :: roblox text color 
Lua :: how to make text different colors in LUA terminal 
Lua :: how to make everyone on team see name roblox 
Lua :: what is a value lua 
Lua :: random number lua 
Lua :: What percentage of developers use Lua 
Lua :: get player who clicked clickdetecter roblox 
Matlab :: to detect if a data frame has nan values 
Matlab :: matlab preallocate array size 
Matlab :: what is java_home 
Basic :: bash catch ctrl-c in a script 
Basic :: remove button selection outline visual basic 
Elixir :: elixir fibonacci 
Elixir :: elixir Creating Custom Sigils 
Scala :: scala predicate 
Actionscript :: truncate restart identity - syntax error at or near "identity" 
Excel :: excel or function 
Perl :: fonction perl 
ADD CONTENT
Topic
Content
Source link
Name
6+9 =