Skip to content

Optimize output of color values #58

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

Closed
wants to merge 1 commit into from
Closed

Optimize output of color values #58

wants to merge 1 commit into from

Conversation

slusarz
Copy link
Contributor

@slusarz slusarz commented Mar 20, 2013

Useful to manipulate colors in integers in PHP code. But once output,
there really is no difference. And this:

#fff

is much more space-efficient than this:

rgb(255,255,255)

(at least for this example, the former is 400% more efficient)

Useful to manipulate colors in integers in PHP code. But once output,
there really is no difference.  And this:

   #fff

is much more space-efficient than this:

   rgb(255,255,255)

(at least for this example, the former is 400% more efficient)
@sabberworm
Copy link
Collaborator

Note that colors do not have to be rgb, they can also be hsl.


$out = sprintf(
'%o2x%02x%02x',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The o should be a 0.

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

Successfully merging this pull request may close these issues.

2 participants