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

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 May. 30th, 2025 08:52 am
Powered by Dreamwidth Studios