Shade of Blue

Shade of Blue

john.uhden
Mentor Mentor
3,476 Views
19 Replies
Message 1 of 20

Shade of Blue

john.uhden
Mentor
Mentor

Is there a way to change the color of blue (5) to a lighter shade?

I really don't want to use a different color, like 150.

We don't use a lot of layers, but we do often change the color of things to blue, including text and mtext.  We use the color pulldown (2002) where it's right there on the list.  But seeing blue against a black background or in the mtext editor is difficult.

I think back in the days of Nth Engine (maybe even SoftEngine) we could do it, but can we do that in plain AutoCAD?

John F. Uhden

0 Likes
Accepted solutions (1)
3,477 Views
19 Replies
Replies (19)
Message 2 of 20

hak_vz
Advisor
Advisor

@john.uhden wrote:  But seeing blue against a black background or in the mtext editor is difficult.

Do you really have to use black background in your work?

Miljenko Hatlak

EESignature

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
0 Likes
Message 3 of 20

roland.r71
Collaborator
Collaborator

@hak_vz wrote:

@john.uhden wrote:  But seeing blue against a black background or in the mtext editor is difficult.

Do you really have to use black background in your work?


No. Just like he doesn't "have to" use blue.

...but that's not the point/question here.

0 Likes
Message 4 of 20

roland.r71
Collaborator
Collaborator

IF there is a way to change the AutoCAD Color Index (ACI), then it should be possible...

 

edit:

A quick lookaround tells me it probably isn't.

...but there is a "workaround" if you are using "bylayer" (& the layer is blue)

Using layerstates, you can save the current layer settings, change blue to a lighter blue

and restore the original layer state when done.

 

Beyond that there doesn't apear to be a way to do it.

 

edit2:

It turns out they already did something in that regard.

---

AutoCAD® uses two different sets of RGB values for a given ACI color, depending on the current drawing background color.

If the background color in AutoCAD is set to black, the RGB color used to represent the ACI color will be slightly lighter. For all other background colors, a slightly darker RGB color is used.

Using two different RGB color sets increases the contrast of the drawing geometry, enhancing display quality.

https://knowledge.autodesk.com/support/autocad/troubleshooting/caas/sfdcarticles/sfdcarticles/RGB-va...

---

Perhaps you should write a request, for an even lighter color. Smiley Wink

0 Likes
Message 5 of 20

john.uhden
Mentor
Mentor
I knew someone would ask that.
I guess it's just habit after 30 years.

I think some architects like a white background, but then, they're
architects. They also do things like rotating the world so that the
building is orthogonal.

John F. Uhden

0 Likes
Message 6 of 20

Kent1Cooper
Consultant
Consultant

@john.uhden wrote:
....
I think some architects like a white background....

 

No doubt some do, but I'm one who prefers black.  It's even harder to see yellow on a white background than it is to see blue on a black one.  And it's too hard to distinguish lots of colors in the darker shades on a white background that are easily distinguishable over black.

Kent Cooper, AIA
0 Likes
Message 7 of 20

Kent1Cooper
Consultant
Consultant

@roland.r71 wrote:

...but there is a "workaround" if you are using "bylayer" (& the layer is blue)

Using layerstates, you can save the current layer settings, change blue to a lighter blue and restore the original layer state when done.

....


 

That may be good for some aspects of desired visibility of colors, but it doesn't really cover this element from Message 1:

"... we do often change the color of things to blue....  We use the color pulldown ... where it's right there on the list...."

 

I would suggest that the simplest thing would be to revise the standard, so that some color other than blue [but another among the first 7 so that it's always "right there"] is standard for whatever those things are.  For already-drawn things, a pretty simple routine could be made that would find everything with blue as a color override, and change that to the other color.

 

Yes, it means limiting the standard to one fewer colors, so it may not be viable if you really need more, such as for range of plotted lineweights or something.

Kent Cooper, AIA
0 Likes
Message 8 of 20

ronjonp
Mentor
Mentor

You could use RGB .. maybe 0,150,255? I use this code daily:

(defun c:clc (/ c d e l)
  ;; RJP » 2018-08-17
  ;; Set layer color by pick
  (or (getenv "clc") (setenv "clc" "(62 . 1)"))
  (cond	((setq c (acad_truecolordlg (read (getenv "clc"))))
	 (setenv "clc" (vl-prin1-to-string (last c)))
	 (setq d (vla-get-activedocument (vlax-get-acad-object)))
	 (while	(and (setq e (car (nentsel "\nSelect entity to change layer color: ")))
		     (setq l (tblobjname "layer" (cdr (assoc 8 (entget e)))))
		)
	   (entmod (append (entget l) c))
	   (vla-regen d acactiveviewport)
	 )
	)
  )
  (princ)
)
(vl-load-com)
0 Likes
Message 9 of 20

roland.r71
Collaborator
Collaborator

@Kent1Cooper wrote:

@roland.r71 wrote:

...but there is a "workaround" if you are using "bylayer" (& the layer is blue)

Using layerstates, you can save the current layer settings, change blue to a lighter blue and restore the original layer state when done.

....


 

That may be good for some aspects of desired visibility of colors, but it doesn't really cover this element from Message 1:

"... we do often change the color of things to blue....  We use the color pulldown ... where it's right there on the list...."

 

I would suggest that the simplest thing would be to revise the standard, so that some color other than blue [but another among the first 7 so that it's always "right there"] is standard for whatever those things are.  For already-drawn things, a pretty simple routine could be made that would find everything with blue as a color override, and change that to the other color.

 

Yes, it means limiting the standard to one fewer colors, so it may not be viable if you really need more, such as for range of plotted lineweights or something.


 

Yes, but then you ignore the line right above that element:

"I really don't want to use a different color, like 150."

 

As far as I can tell, it (the way John would prefer) would only be possible if you can edit the ACI to change the RGB values used for color 5.

0 Likes
Message 10 of 20

john.uhden
Mentor
Mentor
Thanks for your opinion (with which I agree).
Since no one else has suggested a means of changing blue, I think it will
be easy enough to use 150 instead. Once you select it from "Other" it
remains in the list of colors in the pull-down. And then there's always
MATCHPROP.

John F. Uhden

0 Likes
Message 11 of 20

john.uhden
Mentor
Mentor

@roland.r71 wrote, "As far as I can tell, i (the way John would prefer)t would only be possible if you can edit the ACI to change the RGB values used for color 5."

If that is the applicable method, then yes, that is what I would prefer.

I take it that ACI does not stand for the American Concrete Institute.

John F. Uhden

0 Likes
Message 12 of 20

roland.r71
Collaborator
Collaborator

@john.uhden

Lol. No it stands for "Autocad Color Index".

Which apparently has 2 lists of RGB values for each color. One for black backgrounds and one for lighter backgrounds.

 

...but it doesn't seem possible to edit the ACI. As far as I can tell at the moment.

0 Likes
Message 13 of 20

ronjonp
Mentor
Mentor

@john.uhden wrote:
Thanks for your opinion (with which I agree).
Since no one else has suggested a means of changing blue ...

Did you miss THIS? Why would you use a drop down list when you can select an object in the drawing?

0 Likes
Message 14 of 20

john.uhden
Mentor
Mentor

Unfortunately there appears to be no acad_truecolordlg in 2002.

John F. Uhden

0 Likes
Message 15 of 20

ronjonp
Mentor
Mentor

Yowza! 2002 was a loooooong time ago. 🙂

0 Likes
Message 16 of 20

john.uhden
Mentor
Mentor

@ronjonp wrote, "Yowza! 2002 was a loooooong time ago. :)"

So was my 55th birthday.  😕

John F. Uhden

0 Likes
Message 17 of 20

john.uhden
Mentor
Mentor

So that leaves me with an ancillary request.  Is there a way (programmatically) to change the color pulldown to include color 150 at the bottom?

John F. Uhden

0 Likes
Message 18 of 20

john.uhden
Mentor
Mentor
Accepted solution

I think this will cover everything...

(defun c:150 ( / *error* vars vals)
   ; Program changes the color of layers and objects from blue (5) to 150 to make them a little lighter
   ; V1.0 (08-18-2018) for Dover Vinyl
   (gc)
   (prompt "\n150 v1.0 (c)2018, John F. Uhden")
   (or *acad* (setq *acad* (vlax-get-acad-object)))
   (or *doc* (setq *doc* (vla-get-ActiveDocument *acad*)))

   (defun *error* (error)
     (mapcar 'setvar vars vals)
     (vla-endundomark *doc*)
     (redraw)
     (cond
       ((not error))
       ((wcmatch (strcase error) "*QUIT*,*CANCEL*"))
       (1 (princ (strcat "\nERROR: " error)))
     )
     (princ)
   )
   ;;-------------------------------------------
   ;; Intitialize drawing and program variables:
   ;;
   (setq vars '("cmdecho"))
   (setq vals (mapcar 'getvar vars))
   (mapcar 'setvar vars '(0))
   (vla-endundomark *doc*)
   (vla-startundomark *doc*)
   (command "_.expert" (getvar "expert")) ;; dummy command
   (vlax-for layer (vlax-get *doc* 'Layers)
     (if (= (vlax-get layer 'Color) 5)
       (vlax-put layer 'Color 150)
     )
   )
   (vlax-for block (vlax-get *doc* 'Blocks)
     (vlax-for Object block
       (if (= (vlax-get Object 'Color) 5)
         (vlax-put Object 'Color 150)
       )
     )
   )
   (if (= (getvar "cecolor") "5")
     (setvar "cecolor" "150")
   )
   (*error* nil)
)

John F. Uhden

0 Likes
Message 19 of 20

Paul_Gander
Advocate
Advocate

Hi John.

I've just been learning how to use reactors and thought you might find this little routine useful. The reactor is enabled with the command NOBLUE and disabled with NOBLUEOFF. Whilst enabled the program will react to the Zoom command being started (or the mouse wheel double-clicked) and then change all blue objects it finds in the current space to colour 150. It will not change objects nested in existing blocks but was designed only to automatically correct the user's mistakes while they are editing. I hope it will work with your version of AutoCAD but I know you are capable of adapting it to suit your needs.

0 Likes
Message 20 of 20

john.uhden
Mentor
Mentor

That is soooo kind and thoughtful of you.

I actually want a more permanent than temporary fix, but I have another situation at work where your reactor could be a solution.  Bless you for your contribution and keep up the learning.

John F. Uhden

0 Likes