Code Monkey home page Code Monkey logo

noire's People

Contributors

yamiodymel 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

Watchers

 avatar  avatar  avatar

noire's Issues

Half of all hues are inaccessible

It seems hues between 61-200 are not able to be set:

	nc := noire.NewHSV(20, 100, 100)
	h, s, v := nc.HSV()
	fmt.Printf("h=%f s=%f v=%f\n", h, s, v)

	nc = noire.NewHSV(219, 65, 100)
	h, s, v = nc.HSV()
	fmt.Printf("h=%f s=%f v=%f\n", h, s, v)

	nc = noire.NewHSV(299, 100, 100)
	h, s, v = nc.HSV()
	fmt.Printf("h=%f s=%f v=%f\n", h, s, v)

output:

h=20.000000 s=100.000000 v=100.000000
h=339.000000 s=65.100000 v=100.000000
h=59.000000 s=100.000000 v=100.000000

when using a colors AdjustHuemethod like below, hues between 60 and 300 do not produce the expected result:

	nc := noire.NewHSV(1, 100, 100)
	for i := 1; i < 360; i++ {
		h, s, v = nc.HSV()
		fmt.Printf("h=%f s=%f v=%f\n", h, s, v)
		nc = nc.AdjustHue(1.0)
	}

Issues when Saturation = 0

When creating an HSV color with saturation set to 0, the result is consistently a hue of 60, with saturation and value at 100.

Example gist: https://gist.github.com/bcicen/252002e09e55e0439bc400ca785b8bd5

Result:

input: h=320.00 s=100.00 v=100.00
color 255;0;170 h=320.00 s=100.00 v=100.00

input: h=320.00 s=70.00 v=100.00
color 255;77;196 h=320.00 s=69.80 v=100.00

input: h=320.00 s=30.00 v=100.00
color 255;179;230 h=320.00 s=29.80 v=100.00

input: h=320.00 s=10.00 v=100.00
color 255;230;247 h=319.00 s=9.80 v=100.00

input: h=320.00 s=5.00 v=100.00
color 255;242;251 h=318.00 s=5.10 v=100.00

input: h=320.00 s=0.00 v=100.00
color 255;255;0 h=60.00 s=100.00 v=100.00 # yellow

thx for this!

Hey thanks for this, it seems simple and to the point.

No offense, the comments/docs could be in English :D my zhong-guo zhong-wen (see?) is quite bad.. but the code is so clear that it's ok

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.