"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var cache = {};
/**
 * @hidden
 */
function cacheHsva(componentGuid, value, hsva) {
    cache[componentGuid] = { value: value, hsva: hsva };
}
exports.cacheHsva = cacheHsva;
/**
 * @hidden
 */
function cacheRgba(componentGuid, value, rgba) {
    cache[componentGuid] = { value: value, rgba: rgba };
}
exports.cacheRgba = cacheRgba;
/**
 * @hidden
 */
function cacheHex(componentGuid, value, hex) {
    cache[componentGuid] = { value: value, hex: hex };
}
exports.cacheHex = cacheHex;
/**
 * @hidden
 */
function removeCachedColor(componentGuid) {
    delete cache[componentGuid];
}
exports.removeCachedColor = removeCachedColor;
/**
 * @hidden
 */
function getCachedHex(componentGuid, value) {
    if (componentGuid) {
        var cachedColor = cache[componentGuid];
        return cachedColor && cachedColor.value === value ? cachedColor.hex : undefined;
    }
    else {
        return undefined;
    }
}
exports.getCachedHex = getCachedHex;
/**
 * @hidden
 */
function getCachedHsva(componentGuid, value) {
    if (componentGuid) {
        var cachedColor = cache[componentGuid];
        return cachedColor && cachedColor.value === value ? cachedColor.hsva : undefined;
    }
    else {
        return undefined;
    }
}
exports.getCachedHsva = getCachedHsva;
/**
 * @hidden
 */
function getCachedRgba(componentGuid, value) {
    if (componentGuid) {
        var cachedColor = cache[componentGuid];
        return cachedColor && cachedColor.value === value ? cachedColor.rgba : undefined;
    }
    else {
        return undefined;
    }
}
exports.getCachedRgba = getCachedRgba;
