Backstory
I recently needed a way to invert a few Color3 values so I decided to create this module.
Documentation
invert(color: string | Color3, bw: boolean)
color
- HEX string or Color3 to invert
bw
- whether to return a black/white Color3
Example Code
local invert = require(7199428060) -- or require(path.to.module)
-- Hex to Inverted RGB
invert('#ABCDEF') -- Color3.new(0.329412, 0.196078, 0.0627451)
-- RGB to Inverted RGB
invert(Color3.fromRGB(255,0,0)) -- Color3.new(0, 1, 1)
-- Hex to Inverted BW
invert('#FFFFFF', true) -- Color3.new(0,0,0)
-- RGB to Inverted BW
invert(Color3.fromRGB(0,0,0), true) -- Color3.new(1,1,1)
Source
You can view the source here.
You can download the module here.
Happy color-inverting!