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

/**
 *
 * @param {number} r in 0..1 range
 * @param {number} g in 0..1 range
 * @param {number} b in 0..1 range
 * @param {number} a in 0..1 range
 * @returns {number}
 */
export function rgb2uint32(r, g, b, a) {
    const partial = rgb2uint24(r, b, g);

    const _a = float_to_uint8(a);

    return (partial << 8) | (_a & 0xFF);
}