/*!
 * Copyright (c) 2026 Vertex Software LLC. All rights reserved.
 */
import { Color, Mapper as M } from "@vertexvis/utils";
export const fromPbRGBi = M.defineMapper(M.read(M.requiredProp('r'), M.requiredProp('g'), M.requiredProp('b')), ([r, g, b]) => Color.create(r, g, b));
export const toPbRGBi = M.defineMapper((color) => {
    function createRGBi(color) {
        return { r: color.r, g: color.g, b: color.b };
    }
    if (typeof color === 'string') {
        const c = Color.fromHexString(color);
        return c != null
            ? createRGBi(c)
            : { errors: ['String is not a valid color.'] };
    }
    else if (typeof color === 'number') {
        return createRGBi(Color.fromNumber(color));
    }
    else {
        return createRGBi(color);
    }
}, (color) => color);
//# sourceMappingURL=material.js.map
