import { IDisplayManager } from './displayManager' ; import { NodeMaterialBlock } from 'babylonjs/Materials/Node/nodeMaterialBlock' ; import { GradientBlock } from 'babylonjs/Materials/Node/Blocks/gradientBlock' ; export class GradientDisplayManager implements IDisplayManager { public getHeaderClass ( block ) { return "" ; } public shouldDisplayPortLabels ( block ) { return false ; } public getHeaderText ( block ) { return block . name ; } public getBackgroundColor ( block ) { let gradientBlock = block as GradientBlock ; let gradients = gradientBlock . colorSteps . map ( c => `rgb(${ c . color . r * 255 }, ${ c . color . g * 255 }, ${ c . color . b * 255 }) ${ c . step * 100 }%` ) ; return gradients . length ? `linear-gradient(90deg, ${ gradients . join ( ", " ) })` : 'black' ; } public updatePreviewContent ( block , contentArea ) { contentArea . classList . add ( "gradient-block" ) ; } }