Skip to content

Perkovec/colorise-lua

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
src
 
 
 
 
 
 
 
 

Colorise

Color converter for HEX, RGB and RGBA

local color = require "colorise"

print(color.hex2rgb("D2527F")) -- or '#D2527F'
>> 210     82      127
print(color.hex2rgba("D2527FEE")) -- or '#D2527FEE'
>> 210     82      127     238
print(color.rgb2hex({210, 82, 127}))
>> #D2527F
print(color.rgb2hex({210, 82, 127, 238}))
>> #D2527FEE