PackColorBytes
function · unassigned · primitive
- Address
0x7bbec0· 95 bytes, up to0x7bbf1e- Signature
NTempest::CImVector * __thiscall (NTempest::CImVector *this, const NTempest::C3Vector *rgb)- Meaning
- Packs three unit values into bytes through a 512.0 bias, with 0xff alpha
- Confidence
- verified, proof one
- Finding
- ui/colorselect#reading-the-colour
- Test
cmath::color_pack_rgb,ui::colorselect_hsv_roundtrip_chain
Finding: Reading the colour in ui: ColorSelect
OnColorSelect gets the colour as red, green and blue, and GetColorRGB returns the same three:
the colour converted back to channels, each made a byte by adding 512 to v·255, rounding the sum
to a float and keeping its integer part, then divided by 255. The float holds the sum to the
nearest 1/16384, so a channel can read back one step below what SetColorRGB stored, and one
within 1/32768 below a whole step reads back as that step. GetColorHSV returns the three fields
as they are. A grey colour has no hue: converting one with saturation 0 stores the hue −1, so after
SetColorRGB of a grey GetColorHSV returns −1 as the hue.
The derivation is in the doc.
Callers 5
- FillLiquidSwatch terrain
- CSimpleColorSelect::SetWheelTexture ui
- CSimpleColorSelect::Redraw ui
- CSimpleColorSelect::RefreshValueStrip ui
- ColorSelect::GetColorRGB ui
Callees 0
None by a direct call or jump.
Calls and jumps by a bare address, from tables/calls.tsv.