UNPKG

pixel-utils

Version:
10 lines (9 loc) 586 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = convert_raw_multiband_to_rgba_string; function convert_raw_multiband_to_rgba_string(old_no_data_value, new_no_data_value, scalefn1, scalefn2, scalefn3, pixel) { const [r, g, b] = pixel; return `rgba(${r === old_no_data_value ? new_no_data_value : scalefn1(r)}, ${g === old_no_data_value ? new_no_data_value : scalefn2(g)}, ${b === old_no_data_value ? new_no_data_value : scalefn3(b)}, ${r === old_no_data_value || g === old_no_data_value || b === old_no_data_value ? "0" : "255"})`; }