![]() ![]() With the help of our CMYK color tool, you can calculate the desired color. Contrary to the RGB model, in CMYK, white color is the natural color of the background. This model is known as subtractive, as inks subtract the colors from white. CMYK is short for cyan, magenta, yellow, and key (black color). This will allow you to compare it to the HTML color systems. It is one of the most popular forms of color representation and is displayed here to help you get a general idea about the CMYK color model. I’ll be around today and can probably take another look, but I have to admit I’m still not sure I’m working on the right part of the problem, and more information would help.The color model of CMYK is mainly used for printing and never for style sheets or HTML. DeviceHSV values then sent to Arduino via Bluetooth. DeviceRGB values converted to DeviceHSV by code on the device. I also keep feeling like I wish I had more of the code to understand, or rather, a clearer picture of the data flow. FastLED provides one kind of conversion, but the other conversions are undefined. The remote device HSV model, which is probably some kind of a “spectrum” model, andįastLED HSV color model (or models, actually, since one is a spectrum and one is a rainbow)Īnd that we can’t just freely convert from one to the other and back. The LEDs’ RGB hardware (presumably the same as FastLED RGB, and remote device RGB) I continue to keep coming back to the central idea that there are THREE (or four) different color spaces being used here: Thank you so far for the help you gave me! The color is better but there is still a lot of space to: Leds = CHSV( 149, 201, newV ) // I know the cast is not needed… I already tested this on my Arduino Uno (with the color given above 0x123456):ĭouble newV = sqrt(oldV * 256) // newV is now 148.38 So as far as I understood, I “just” have to cancel out the gamma correction by recalculate the V-Value like:īecause all the Arduinos I own has a 8-bit CPU and I only know about the simple sqrt() function of the ArduinoIDE. I do actually have a lot of different effects which are all “based” (looks better) in the rainbow (adjusted) HSV color space.įor example a rainbow fade through the hue looks much better because of better illustration of red and yellow.īut you know that as this was the reason why you created this rainbow HSV color space. The result was, that “rainbow hsv” looks better in my effects. In the past I already did some checking in both of theese to figure out which one I prefere. Well thats right, that FastLED has 2 kinds of HSV color spaces. ![]() The check this you can try this calculator linked above and check it with my values given before: There is of course a Hue range from 0° to 359°.Īlso the percentage values of the “RGB to HSV color conversion”-calculator are in a range of 0-255. You can easyly check it out and convert it like… You can check it with this simple arduino Code with you LEDs connected to Pin13 and shortened GNDs: I checked it with the Hex value: 0x123456 I checked everything with a simple test code and found out, that not RGB translation is the problem.Īfter saving the RGB values I do a litte effect and light the LEDs up with increasing the v-Value of this color “translated” to HSV. Well the Code I have is really specific and I worked half an year on it, so it will be hard to get the important stuff for others. So share some code, and some printed-out values of what you’re seeing, and we’ll help get it all working. ![]() First, could you share a block of your code that’s having the trouble, showing us the data type (“int”, “long unsigned int”, etc) of all the relevant variables?Īnd second, could you instrument the code to print out the R, G, and B values that you are getting? That might help pinpoint the problem.Īs one last item, you can also retrieve the RGB color values from a pixel like this: I think in order to diagnose your specific code a little more deeply, I’d ask for two things. Then the code prints the expected result, because now the “+” operator knows that it’s adding two 32-bit values, and not to truncate the result to 16 bits. ![]() If you change line 2 (above) to say unsigned long int sum = (unsigned long)(i) + (unsigned long)(i) This is because the “+” operator on the second line only produces a 16-bit result ((40000 + 40000) % 65536) and then that value is stored into “sum”, and printed. However, if you run this on an AVR Arduino, it prints 14464. You’d expect this code to print 80000, because “i” is big enough to hold “40000”, and “sum” is big enough to hold “80000”. Often intermediate results get passed through a 16-bit integer and unexpectedly truncated. Hi- I suspect you’re seeing something related to plain old integer wrap-around in C, arising from the fact that on AVR Arduino’s default “integer” size is just 16 bits. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |