Git Product home page Git Product logo

hsluv-c's Introduction

CI

HSLuv - Human-friendly HSL

This website is hosted on https://www.hsluv.org

The reference implementation is written in Haxe.

To build website:

npm run build

To start localhost server:

npm run serve

Shared credentials

We are using public key cryptography to share credentials. Contributors' public keys are stored in PEM format in secrets/public. A plaintext secrets.txt file, which is ignored by git, is encrypted using each of these public keys and stored in the repo in its encrypted form. It can be decrypted by anyone posessing a private key that corresponds to one of the shared public keys.

To decrypt secrets (overwriting secrets.txt):

./secrets.sh --decrypt ~/.ssh/myprivatekey secrets/symmetric/myusername.enc.txt

After updating secrets.txt or adding a new PEM file to secrets/public, secrets need to be re-encrypted. To encrypt secrets:

./secrets.sh --encrypt

Don't forget to commit re-encrypted secrets after running the command above.

PEM files

To generate PEM file from public key:

ssh-keygen -f ~/.ssh/id_rsa.pub -e -m PKCS8 > myusername.pem

GPG key

To create signed packages (e.g. for Maven Central) we need a GPG key. A GPG key shared by all the contributors is located in secrets. The private key is protected by a passphrase which can be found in secrets.txt. Our shared key is set to expire in 1 year.

Generating GPG key:

gpg --gen-key
gpg --list-keys
gpg --output hsluvcontributors_pub.gpg --armor --export 381DF082
gpg --output hsluvcontributors_sec.gpg --armor --export-secret-key 381DF082

hsluv-c's People

Contributors

boronine avatar hartwork avatar joemalle avatar mity avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hsluv-c's Issues

Which version of C โ€” c89? c99?

Hi!

Is this project using c89 or c99? It would be great to document it and maybe also to add compile flags that make sure that there are no regressions regarding that choice, e.g. -std=c89 -pedantic. At least in case of c89. What do you think?

Best, Sebastian

Current CMake test integration

Hi!

I noticed that the current integration of tests with CMake needs users to learn about ./tests/test_hsluv themselves, e.g. by looking at .travis.yml or tests/CMakeLists.txt, and then running that command. CMake has add_test and enable_testing that allow plain make test to the user. Is that something you decided against on purpose?

If make test is intended to not be supported, maybe the readme could have a sentence about how to run tests.

What do you think?

hsluv2rgb returns values outside the 0-1 range

Modifying the test suite slightly to add assertions the returned rgb values are in [0,1] range as documented makes the tests fail for several cases, '#ffdd00' for example.

Admittedly the error is only in the 1e-14 range so absolutely tiny, but enough to trip assertions if those values are passed along to other function that validate their inputs.

Saturation Range for HPLuv is not 0...100

In src/hsluv.h the documentation says for rgb2hpluv: @param[out] ps Saturation. Between 0.0 and 100.0. but I think this is incorrect.

When passing the RGB values 1,1,0 (yellow) the returned Saturation is 1784.236 and for other colors it is also bigger then 100. The values are not wrong according to the CIELUV color space, only the documentation states it incorrectly.

The result from rgb2hpluv also correctly converts back to the original color when using hpluv2rgb.

The problem with Saturation values higher than 100 is that hpluv2rgb might return invalid RGB values.
Only combinations of HPL values within 0...360, 0...100, 0...100 are always valid. But a user of the function can distinguish this by checking that the returned RGB values are in the range 0...100 and conclude otherwise that the HPL values were invalid.

I think it would be helpful to describe this in the documentation.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.