Loading

HSV to RGB OpenSCAD Library

by thingiverse, published

HSV to RGB OpenSCAD Library by thingiverse Mar 27, 2014

Description

This is a small utility to convert hue-saturation-value colors into RGB colors for use with [OpenSCAD's](http://www.openscad.org) color() module.

Check out the [instructions tab](http://www.thingiverse.com/thing:279951/#instructions) to see more detail.

[Edit: fixed a bug where hue was actually being set by 0-360 not 0.0 - 1.0]

Liked By

view all

Give a Shout Out

If you print this Thing and display it in public proudly give attribution by printing and displaying this tag. Print Thing Tag

Instructions

To use it in your own project, download the .scad and put it in your openscad library folder or in the same folder as the project you are using it in. Then, at the top of your script just type:

`use `

We've also included this in Customizer! Include it in your customizers by typing:

`use `

the useful function in this lib is:

`function hsvToRGB(h, s, v, a)`
give this function a hue, saturation, value, and alpha between 0.0 and 1.0 and it will return a vector with RGBA values in [r, g, b, a] format with values between 0.0 and 1.0
Top