Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
Home
Help
Login
Register
TheSwamp
»
Code Red
»
AutoLISP (Vanilla / Visual)
»
Topic:
Translate CECOLOR from RGB string to OLE color
« previous
next »
Print
Pages: [
1
] |
Go Down
Author
Topic: Translate CECOLOR from RGB string to OLE color (Read 1237 times)
0 Members and 1 Guest are viewing this topic.
Pepe
Newt
Posts: 87
Translate CECOLOR from RGB string to OLE color
«
on:
August 20, 2020, 07:52:17 AM »
A simple question:
My current editor color is set as a 'true color' (CECOLOR variable value is a string) and I need to translate it into an OLE color number.
Is there any easier way to get it rather than dealing with the string?
Logged
hmspe
Bull Frog
Posts: 362
Re: Translate CECOLOR from RGB string to OLE color
«
Reply #1 on:
August 20, 2020, 08:45:42 AM »
No direct conversion that I know of, but Lee Mac's LM:parsenumbers function makes handling the string easy.
Logged
"Science is the belief in the ignorance of experts." - Richard Feynman
RGUS
Newt
Posts: 106
Re: Translate CECOLOR from RGB string to OLE color
«
Reply #2 on:
August 20, 2020, 10:13:39 AM »
Lee Mac has the answer. I hope I can post this link Lee.
http://www.lee-mac.com/colourconversion.html
Logged
Pepe
Newt
Posts: 87
Re: Translate CECOLOR from RGB string to OLE color
«
Reply #3 on:
August 20, 2020, 10:50:58 AM »
Thank you both!
I know those useful Lee-Mac's works.
This is the way I get it dealing with the string and using Lee-Mac's stuff:
Code - Auto/Visual Lisp:
[Select]
(
eval
(
read
(
strcat
"(LM:RGB->OLE "
(
vl-string-translate
","
" "
(
vl-string-left-trim
"RGB:"
(
getvar
"CECOLOR"
)
)
)
")"
)
)
)
;;other way
(
apply
'LM:RGB
->
OLE
(
read
(
strcat
"("
(
vl-string-translate
","
" "
(
vl-string-left-trim
"RGB:"
(
getvar
"CECOLOR"
)
)
)
")"
)
)
)
So, i was trying to find a shortcut...
Logged
Print
Pages: [
1
] |
Go Up
« previous
next »
TheSwamp
»
Code Red
»
AutoLISP (Vanilla / Visual)
»
Topic:
Translate CECOLOR from RGB string to OLE color