Skip to content

Commit

Permalink
Named colors
Browse files Browse the repository at this point in the history
  • Loading branch information
Petr Knap committed Sep 29, 2016
1 parent 5e24d32 commit d6223e7
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/Profiler/Adapter/TracyBarAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,11 @@ public function getPanel()

private function getMemoryChart()
{
$colors = ["#000000", "#cccccc", "#6ba9e6"];
$colors = [
"axis" => "#000000",
"gridLines" => "#cccccc",
"memoryUsage" => "#6ba9e6"
];
$maxWidth = 596;
$maxHeight = 86;
$gridStep = 10;
Expand All @@ -107,7 +111,7 @@ private function getMemoryChart()
$tmpY + $margin,
$maxWidth + $margin,
$tmpY + $margin,
$colors[1]
$colors["gridLines"]
);
}
for ($tmpX = $gridStep; $tmpX < $maxWidth; $tmpX += $gridStep) {
Expand All @@ -117,7 +121,7 @@ private function getMemoryChart()
$margin,
$tmpX + $margin,
$maxHeight + $margin,
$colors[1]
$colors["gridLines"]
);
}

Expand All @@ -142,7 +146,7 @@ private function getMemoryChart()
$prevY + $margin,
$thisX + $margin,
$thisY + $margin,
$colors[2]
$colors["memoryUsage"]
);
$prevX = $thisX;
$prevY = $thisY;
Expand All @@ -154,15 +158,15 @@ private function getMemoryChart()
$maxHeight + $margin,
$maxWidth + $margin,
$maxHeight + $margin,
$colors[0]
$colors["axis"]
);
$memoryChart .= sprintf(
"<line x1='%d' y1='%d' x2='%d' y2='%d' stroke-width='1' stroke='%s' />",
$margin,
$margin,
$margin,
$maxHeight + $margin,
$colors[0]
$colors["axis"]
);

$memoryChart .= "</svg>";
Expand Down

0 comments on commit d6223e7

Please sign in to comment.