All files / Sources/Widgets/Core/StateBuilder color3Mixin.js

100% Statements 4/4
0% Branches 0/1
100% Functions 1/1
100% Lines 4/4

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22          1x               57x 57x 57x            
import macro from 'vtk.js/Sources/macros';
/**
 * RGB Uint8 color mixin. Not to be used in conjunction with `color` mixin.
 * @see color
 */
const DEFAULT_VALUES = {
  color3: [255, 255, 255],
  opacity: 255,
};
 
// ----------------------------------------------------------------------------
 
export function extend(publicAPI, model, initialValues = {}) {
  Object.assign(model, DEFAULT_VALUES, initialValues);
  macro.setGetArray(publicAPI, model, ['color3'], 3, 255);
  macro.setGet(publicAPI, model, ['opacity']);
}
 
// ----------------------------------------------------------------------------
 
export default { extend };