elfs: (Default)
[personal profile] elfs

I recently had to convert a few GIMP palettes into color schemes for a website, and since I’m very fond of LessCSS, I decided to create LessCSS variables and use that as a plug-in to my CSS.   The trick was converting on the fly; GIMP palettes store their variables in decimal, and I like my variable names lower-case for neatness.  Nobody but me needs this, but here it is in all of its glory:

perl -ne '($a,$b,$c,$d) = m/^\s*(\d+)\s+(\d+)\s+(\d+)\s+(\w.*)$/; $d=~s/ /-/g; print sprintf("@%s: #%x%x%x;\n", lc($d), $a, $b, $c);' < palette.gpl > colors.less

This entry was automatically cross-posted from Elf's technical journal, ElfSternberg.com
This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

Profile

elfs: (Default)
Elf Sternberg

May 2025

S M T W T F S
    123
45678910
111213141516 17
18192021222324
25262728293031

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jun. 2nd, 2025 08:26 pm
Powered by Dreamwidth Studios