- Documentation
- Shared functions
- bitRShift
Function
bitRShift
Logical right shift (unsigned): zeros come in from the left.
Syntax
int bitRShift(int value, int count)Arguments
valueint- The number.
countint- Shift count.
Returns
The result.
Example
Splitting a 0xAARRGGBB color into parts.
local color = tocolor(255, 128, 0, 200)
local a = bitAnd(bitRShift(color, 24), 0xFF)
local r = bitAnd(bitRShift(color, 16), 0xFF)
local g = bitAnd(bitRShift(color, 8), 0xFF)
local b = bitAnd(color, 0xFF)
print(r, g, b, a)