/*!
 * Copyright (c) 2026 Vertex Software LLC. All rights reserved.
 */
import { Color } from "@vertexvis/utils";
export const defaultColor = {
    opacity: 255,
    glossiness: 4,
    diffuse: {
        r: 0,
        g: 0,
        b: 0,
        a: 0,
    },
    ambient: {
        r: 0,
        g: 0,
        b: 0,
        a: 0,
    },
    specular: {
        r: 0,
        g: 0,
        b: 0,
        a: 0,
    },
    emissive: {
        r: 0,
        g: 0,
        b: 0,
        a: 0,
    },
};
/**
 * This helper creates an rgb value color
 * @param hex
 * @param opacity
 */
export const create = (r, g, b, opacity) => {
    return {
        ...defaultColor,
        opacity: opacity !== null && opacity !== void 0 ? opacity : defaultColor.opacity,
        diffuse: {
            r,
            g,
            b,
            a: 0,
        },
    };
};
/**
 * This helper converts a hex string to a ColorMaterial object
 * @param hex
 * @param opacity
 */
export const fromHex = (hex, opacity) => {
    const color = Color.fromHexString(hex);
    return {
        ...defaultColor,
        opacity: opacity !== null && opacity !== void 0 ? opacity : defaultColor.opacity,
        diffuse: color != null ? { ...color } : { ...defaultColor.diffuse },
    };
};
//# sourceMappingURL=colorMaterial.js.map
