Start a new topic

color management

 In the design stage of a project it would be nice to be able to type in a number for the color of a component.

At the very least the color tool should have the ability to "Add to Custom Colors" and save the result.

2 people like this idea

In fact you can. :)

 I am using V0.28 and the custom color is not saved. Yes I can make a custom color and I can add it to the custom color list but once I click OK the custom color is gone from the list.  :(

I think this issue can be considered as a bug.. :(

Will be fixed soon.

2 people like this

I am using V0.31 and the custom color is still not saved. Please also add directly input of color number (bco,pco...). Now is very annoying to match colors. :(

4 people like this

So I have a colour 33973. How can I do to convert this number to the equivalent RGB and to Hue Sat Lum?

It is very frustrating to come after some weeks and cannot locate the same colour I used previously. The Eye Dropper should give the opportunity to enter a number and an equivalent colour comes up.

Agree 100% with Tona to add directly input of color number to bco,pco.


The colors are in 16-bit 565 format.   Hue Sat Lum is calculated when RGB is entered.

For sake of correctness, H/S/L input could also calculate RGB, but most people never think in H/S/L.

24 bit RGB in binary is RRRRRRRR GGGGGGGG BBBBBBBB or in Hexadecimal as FF FF FF

565 uses 5 upper bits of red, 6 from green, and 5 from blue: RRRRRRRR GGGGGGGG BBBBBBBB

Therefore your color 33973: red is 128 green is 148 and blue is 21.  in RGB Hexadecimal 8094A8.

33973 / 2048 = 16.  16 * 8 = 128   Red

(33973 % 2048) / 32 = 37.  37 * 4 = 148   Green

(33973 / 32) = 21.  21 * 8 = 168  Blue.

Although I agree numeric input for colors should be an option, knowing how to calculate 565 is important

2 people like this

Thanks Patrick. What a detailed explanation. Much appreciated.



I agree, allow custom colors to be saved and allow us to add custom colors by number ie: black = 0, Green =2016... 

Just a correction in blue calculation above:

(33973 / 32) = 21.  21 * 8 = 168  Blue

should have read:

(33973 % 32) = 21.  21 * 8 = 168  Blue

Sorry for my ignorance in maths, but please how you work out that %?

i.e.: - 3397 % 32



No problem, It is a computer thang.  % is the symbol for the modulo operator.

The Nextion uses integer based math and does not have floating point. 

Normally with floating point 14 / 5 = 2.8, but without floating point it is just 2.

So with division in integer math there is a quotient and the remainder.

example: using our 14 divided by 5

va0.val=14/5 on the nextion will give you your 2  (quotient in whole numbers)

va0.val=14%5 on the nextion will give you your 4 (remainder, mod, or modulus)

Patrick, That make more sense, but what if I have to work it out by calculator? 33973 % 32 with a calculator how would I do it? The reason is that if I have a colour number and want to extract the 565 equivalent. Thanks

If your calculator can put 33973 into its binary to 16 places

10000-100101-10101  5-6-5 is easier to see

33973 is the decimal value of a 565  (ranging from 0 black to 65535 white)

The calculations are a few posts above.

if you are wondering how to get the modulus with a calculator that is giving a decimal float?

Remainder of 33973 divided by 32

33973 % 32 can be found as

number divided by 32 = answer - quotient = answer less than 1 * 32 = integer remainder

33973 / 32 = 1061.65625 - 1061 = 0.65625 * 32 = 21

If you are still having ... issues?  Perhaps explain how you get your color numbers

example in RGB #CC9966 - explain what is your input

and exactly what you want to know:

? final 565 number

? decimal values needed to put into color selector

whatever - and perhaps I can code you a little windows desktop utility.

A little windows desktop utility would be super.

As here we are talking about Nextion, the final number would be decimal values to put into colour selector. The problem with Nextion, as explained elsewhere, is that sometimes you choose a colour and you have a number, in my example 33973. There is no way, even if you use the eye dropper, to get the decimal values if you return to the project later and you specifically need that colour.

I thank you in advance for the application, but Nextion in the eye dropper should include a converter from RGB565 to HEX to  decimal values to put into colour selector, and entering value in a relevant box, i.e. HEX box, the other two boxes gives the corresponding figures.

Thank you



Login or Signup to post a comment