Page 2 of 2

Re: How to get the current brush color ?

Posted: Thu Jun 03, 2021 8:14 am
by richmond62
https://youtu.be/kN9xP4aq3iA

Well done bogs: very impressive channel! 8)

Re: How to get the current brush color ?

Posted: Fri Jun 04, 2021 12:41 am
by kdjanz
Sticking to LC you can use

Code: Select all

the colornames
and if you

Code: Select all

put the length of the colornames
into the message box, I found that LC understands 5390 colornames out of the box. Should be a good start.

In a former life I was an architect, and every office has a product library in a backroom somewhere that is filled with flooring, carpet, paint, plastic laminate etc. samples. Each of these products come in various colours - sometimes MANY colours (paint!) which each have a code and an English name. These names were a source of huge amusement and we all wondered who on earth came to the office each morning and dropped a tab of LSD, then toked up a big one and then sat down to name this year's set of colours. Some of the names very clearly had chemical help in their conception!

Re: How to get the current brush color ?

Posted: Fri Jun 04, 2021 8:20 am
by richmond62
I found that LC understands 5390 colornames out of the box.
Well, be that as it may, when I did this:

Code: Select all

put the colornames into fld "COLOURS"
followed by this:

Code: Select all

put the number of lines of fld "COLOURS"
I got 552.

Re: How to get the current brush color ?

Posted: Fri Jun 04, 2021 11:46 am
by bogs
Heh, "length" ≠ the number of lines of the colorNames, whatever on earth made you use length? Length returns the number of characters in a string, so I am VERY sure that 500+ names could easily return 10x that in characters :D

As Richmond points out, the colorNames function puts the names on separate lines by default, from the msg box you could simply use

Code: Select all

put the number of lines of the colorNames

or, if you really wanted to get fancy, maybe even

Code: Select all

put the number of lines of the colorNames & " Color Names are in the following list:" & cr & cr & the colorNames
In any case, I completely agree with you, Lc provides more than enough color names. I wrote the utility I posted the link to there mostly because I thought it would be easier to actually see the color, and copy whatever values I needed from it, than it was to keep going back to the message box and get that information long hand from scratch each time.

Shockingly, it worked out rather well, if not overly attractive.