Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can get the color ratio #46

Open
songyongshuo opened this issue Apr 30, 2019 · 0 comments
Open

Can get the color ratio #46

songyongshuo opened this issue Apr 30, 2019 · 0 comments

Comments

@songyongshuo
Copy link

Update file CMap.php:28

public function palette()
{

$total = array_sum($this->vboxes->map(function ($x) {
    return $x['vbox']->count();
}));

return $this->vboxes->map(function ($vb) use ($total) {
    return array($vb['color'], intval($vb['vbox']->count() / floatval($total) * 100));
});

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant