Skip to main content

glintColorForName

Adds a color gradient to the background of a panel or <div>. The hue of the color is picked by applying a hashing function on the provided name. This will ensure the same color is picked for the same name, but the colors are still semi-random between different names.

<glint-panel [glintColorForName]="model.name" hueRange="[150, 320]">
<!-- ... -->
</glint-panel>
  • [glintColorForName]: Pass a name as value on which the color is based.
  • hueRange: An array of 2 numbers between 0 and 360 defining the range of hues that the directive should pick from.