import { float_to_uint8 } from "../binary/float_to_uint8.js";

/**
 *
 * @param {number} r in 0..1 range
 * @param {number} g in 0..1 range
 * @param {number} b in 0..1 range
 * @returns {number}
 */
export function rgb2uint24(r, g, b) {
    const _r = float_to_uint8(r);
    const _g = float_to_uint8(g);
    const _b = float_to_uint8(b);

    return (_b & 0xFF)
        | (_g & 0xFF) << 8
        | (_r & 0xFF) << 16
        ;
}

