http://qs1969.pair.com?node_id=11129225

in reply to Re: Ordering Colours Problem

> Black appearing second after red is puzzling, though

If you run my code several times, you'll see the black and red are sometimes swapped. That's because black is in fact the darkest possible red :-)

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

Replies are listed 'Best First'.
Re^3: Ordering Colours Problem
by vr (Curate) on Mar 07, 2021 at 07:53 UTC

Oh, I see: sort is performed on keys of derived hash, not original list. Hence the unstable result.

Re^3: Ordering Colours Problem
by LanX (Sage) on Mar 07, 2021 at 01:13 UTC
In the page you linked to one finds the HLS model visualized as a cylinder = 2d-circle x height. (A round cake )

While height is (L)umidity, does the distance to the circles center represent (S)aturation.

The axis of that cylinder, the circles center (S=0) is the gray-scale, with black at the bottom (L=0) and white at the top (L=1) and belongs to all "colors" of that wheel.

I.e one point on the wheel represents all colors in the rectangle formed by axis and angle. (The side of a cakepiece)

Crazy!

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery