UnpackColorBytes
function · unassigned · primitive
- Address
0x7bbf20· 68 bytes, up to0x7bbf63- Signature
NTempest::C3Vector * __thiscall (NTempest::CImVector *this, NTempest::C3Vector *rgb)- Meaning
- Unpacks three bytes into unit values times 1/255
- Confidence
- verified, proof one
- Finding
- ui/colorselect#setting-the-colour
- Test
cmath::color_unpack_rgb,ui::colorselect_hsv_roundtrip_chain
Finding: Setting the colour in ui: ColorSelect
SetColorRGB(r, g, b) clamps each channel to 0 to 1, turns it into a byte by
trunc(v·255 + 0.5), divides the bytes by 255 and converts them to hue, saturation and value. A
fifth argument is read and discarded. SetColorHSV(h, s, v) stores its three numbers as given,
unclamped. Both then redraw and run OnColorSelect, on every call, changed or not.
The derivation is in the doc.
Callers 4
- CharSelectLightCallback glue
- FillLiquidSwatch terrain
- SimpleModelLightCallback ui
- ColorSelect::SetColorRGB ui
Callees 0
None by a direct call or jump.
Calls and jumps by a bare address, from tables/calls.tsv.