BernieC has asked for the wisdom of the Perl Monks concerning the following question:

I'm doing some graphics hacking with the SVG module and it works great.. but... RBG is a bit of a crude color hammer. Is there a way to do HSL or HSV color selection with the SVG module?

Replies are listed 'Best First'.
Re: HSV/HSL in SVG?
by choroba (Cardinal) on May 16, 2022 at 11:23 UTC
    Convert::Color?

    map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

      I started to reply with a link to the relevant formulas on Wikipedia but then looking in the source for e.g. Convert::Color::HSV it already contains a link to the same so this is probably the best place to start if you want off-the-shelf.

      The cake is a lie.
      The cake is a lie.
      The cake is a lie.

        Perfect.. thanks!!
Re: HSV/HSL in SVG?
by etj (Priest) on May 18, 2022 at 23:30 UTC