sorcery  Diff

Differences From Artifact [e07c3f3979]:

To Artifact [818d3ded97]:

  • File lib/color.lua — part of check-in [ea6e475e44] at 2020-10-19 09:52:11 on branch trunk — continue dev on celestial mechanics, add melding+division spells (resonance), refine itemclasses, add keypunch and punchcards, add paper pulp, add a shitload of visuals, add convenience scripts for working with the wiki, make the flamebolt spell actually useful instead of just a pretty lightshow, add essences, inferno crystal, and other goodies; iterate on wands, lots of shit i can't remember, various bugfixes (user: lexi, size: 5988) [annotate] [blame] [check-ins using]

   197    197   				new.green = clip(new.green - (new.green * fac))
   198    198   			end);
   199    199   		}
   200    200   		if g == nil then
   201    201   			if type(r) == 'string' then
   202    202   				assert(false) -- TODO parse color string
   203    203   			elseif type(r) == 'table' then
   204         -				new.red = r[1]
   205         -				new.green = r[2]
   206         -				new.blue = r[3]
   207         -				new.alpha = r[4]
          204  +				if r.hue then
          205  +					return from_hsl(r, r.alpha or g)
          206  +				else
          207  +					new.red = r[1]
          208  +					new.green = r[2]
          209  +					new.blue = r[3]
          210  +					new.alpha = r[4]
          211  +				end
   208    212   			else assert(false) end
   209    213   		else
   210    214   			new.red = r
   211    215   			new.green = g
   212    216   			new.blue = b
   213    217   			new.alpha = a
   214    218   		end
   215    219   		return new
   216    220   	end
   217    221   }
   218    222   return color