MCPcopy Create free account
hub / github.com/google/pprof / makeColor

Function makeColor

internal/driver/html/stacks.js:603–611  ·  view source on GitHub ↗
(index)

Source from the content-addressed store, hash-verified

601 }
602
603 function makeColor(index) {
604 // Rotate hue around a circle. Multiple by phi to spread things
605 // out better. Use 50% saturation to make subdued colors, and
606 // 80% lightness to have good contrast with black foreground text.
607 const PHI = 1.618033988;
608 const hue = (index+1) * PHI * 2 * Math.PI; // +1 to avoid 0
609 const hsl = `hsl(${hue}rad 50% 80%)`;
610 return hsl;
611 }
612}
613
614// pprofUnitText returns a formatted string to display for value in the specified unit.

Callers 1

drawBoxFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…