jscad / csg.js

DEPRECATED: CSG Library for JSCAD (See the link below)
https://github.com/jscad/OpenJSCAD.org/tree/master/packages/modeling
MIT License
217 stars 56 forks source link

Reorganization of Color #185

Closed z3dev closed 5 years ago

z3dev commented 5 years ago

This pull request adds the color functions as a seperate module. The goals are:

color

Overall test coverage 83.87%.

z3dev commented 5 years ago

This could be the last reorganization.

@kaosat-dev I believe this is the correct location of the color module. Please review.

z3dev commented 5 years ago

I will add some support for HEX ALPHA, RGBA and HSLA, as per web standards.

https://www.w3schools.com/cssref/css_colors_legal.asp

@kaosat-dev how about removing support for passing arrays? I don’t like the code that suppprts arrays, and actually had to fix most of the logic.

kaosat-dev commented 5 years ago

@z3dev do you mean arrays passed to the various conversion functions ? I think that makes sense, users can use funct(...array) to have the same effect right ? hmm then again, one of the foundations of V2 was the use of arrays (which is very practical in a ton of cases). or switch to JUST arrays ?

z3dev commented 5 years ago

or switch to JUST arrays ?

All conversion functions have been changed to accept an array of RGB/HSL/HSV values, only. I think this looks far better.

@kaosat-dev please review again

z3dev commented 5 years ago

I created a new issue #187 to review these changes as part of the cleanup phase.

@kaosat-dev please merge if satisfied.

kaosat-dev commented 5 years ago

well done @z3dev !