Canceling a color specificationRandomly assigning color to Graphics3D objects?Default color for Filling in Mathematica 9Coloring specific elements of sets with a prime modified order in an array plotHow to pick a color differing significantly from the colors already in a given color list?Detection of the text colorColor numbers based on their valueCan color schemes for use with ColorData include opacity specification?My dynamic color schemes

Would it be easier to colonise a living world or a dead world?

Postal services in Italy - Poste Italiane vs. Friendpost vs. GPS

What is /dev/null and why can't I use hx on it?

Why are engines with carburetors hard to start in cold weather?

How to make a gift without seeming creepy?

Without exposing his identity, did Roy help his parents with money so that they can afford to stay in their home?

Does the Creighton Method of Natural Family Planning have a failure rate of 3.2% or less?

How do I break the broom in Untitled Goose Game?

Had there been instances of national states banning harmful imports before the mid-19th C Opium Wars?

D&D Monsters and Copyright

Is sleeping on the groud in cold weather better than on an air mattress?

Transiting through Switzerland by coach with lots of cash

quadratic equations on 2 by 2 matrices

Always Lubricate Skewers?

I pay for a service, but I miss the broadcast

Iron-age tools, is there a way to extract heavy metals out of a creature?

"Es gefällt ihm." How to identify similar exceptions?

Is the text of all UK treaties and laws public?

Landing Hero: Product snippets VS illustrations

Find the percentage

Why would they pick a gamma distribution here?

How did the Fried Liver Attack get its name?

Son of the Revenge of the Riley Riddles in Reverse Strikes Again

Can something have more sugar per 100g than the percentage of sugar that's in it?



Canceling a color specification


Randomly assigning color to Graphics3D objects?Default color for Filling in Mathematica 9Coloring specific elements of sets with a prime modified order in an array plotHow to pick a color differing significantly from the colors already in a given color list?Detection of the text colorColor numbers based on their valueCan color schemes for use with ColorData include opacity specification?My dynamic color schemes






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;

.everyonelovesstackoverflowposition:absolute;height:1px;width:1px;opacity:0;top:0;left:0;pointer-events:none;








3












$begingroup$


I can get the default colors for one figure (Cuboid), and then color another figure (Sphere), as here:



Graphics3D[
Cuboid[],
Red, Sphere[]
]


enter image description here



However, if I create the figures in the reverse order (Cuboid first, Sphere second), I need to "cancel" the color specification (from the sphere) so that the Cuboid is in its default colors. I've tried FaceForm[Automatic] and variations, but these do not work.



Of course I could always specify the order of rendering to place the colors last, or explicitly place colored objects in Lists, but that is a bit tedious for many of my figures.










share|improve this question











$endgroup$









  • 2




    $begingroup$
    Why don't you group the colour with the object? Cuboid[], Red, Sphere[].
    $endgroup$
    – Szabolcs
    8 hours ago











  • $begingroup$
    @Szabolcs: Yes, I can do that (+1), but I generate some figures algorithmically, and it gets a bit complicated to do this (though not impossible). Is there really no way to "cancel" a previous color specification? By analogy, one can "cancel" a Dashing specification with Dashing[None].
    $endgroup$
    – David G. Stork
    8 hours ago






  • 2




    $begingroup$
    I believe the default is White.
    $endgroup$
    – Szabolcs
    8 hours ago










  • $begingroup$
    @Szabolcs: Ah yes... helpful. I didn't think the default was White given the rendered colors. But this appears to work. (You can post this as a quick solution and I'll accept it.)
    $endgroup$
    – David G. Stork
    7 hours ago

















3












$begingroup$


I can get the default colors for one figure (Cuboid), and then color another figure (Sphere), as here:



Graphics3D[
Cuboid[],
Red, Sphere[]
]


enter image description here



However, if I create the figures in the reverse order (Cuboid first, Sphere second), I need to "cancel" the color specification (from the sphere) so that the Cuboid is in its default colors. I've tried FaceForm[Automatic] and variations, but these do not work.



Of course I could always specify the order of rendering to place the colors last, or explicitly place colored objects in Lists, but that is a bit tedious for many of my figures.










share|improve this question











$endgroup$









  • 2




    $begingroup$
    Why don't you group the colour with the object? Cuboid[], Red, Sphere[].
    $endgroup$
    – Szabolcs
    8 hours ago











  • $begingroup$
    @Szabolcs: Yes, I can do that (+1), but I generate some figures algorithmically, and it gets a bit complicated to do this (though not impossible). Is there really no way to "cancel" a previous color specification? By analogy, one can "cancel" a Dashing specification with Dashing[None].
    $endgroup$
    – David G. Stork
    8 hours ago






  • 2




    $begingroup$
    I believe the default is White.
    $endgroup$
    – Szabolcs
    8 hours ago










  • $begingroup$
    @Szabolcs: Ah yes... helpful. I didn't think the default was White given the rendered colors. But this appears to work. (You can post this as a quick solution and I'll accept it.)
    $endgroup$
    – David G. Stork
    7 hours ago













3












3








3


1



$begingroup$


I can get the default colors for one figure (Cuboid), and then color another figure (Sphere), as here:



Graphics3D[
Cuboid[],
Red, Sphere[]
]


enter image description here



However, if I create the figures in the reverse order (Cuboid first, Sphere second), I need to "cancel" the color specification (from the sphere) so that the Cuboid is in its default colors. I've tried FaceForm[Automatic] and variations, but these do not work.



Of course I could always specify the order of rendering to place the colors last, or explicitly place colored objects in Lists, but that is a bit tedious for many of my figures.










share|improve this question











$endgroup$




I can get the default colors for one figure (Cuboid), and then color another figure (Sphere), as here:



Graphics3D[
Cuboid[],
Red, Sphere[]
]


enter image description here



However, if I create the figures in the reverse order (Cuboid first, Sphere second), I need to "cancel" the color specification (from the sphere) so that the Cuboid is in its default colors. I've tried FaceForm[Automatic] and variations, but these do not work.



Of course I could always specify the order of rendering to place the colors last, or explicitly place colored objects in Lists, but that is a bit tedious for many of my figures.







color faceform






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 2 hours ago







David G. Stork

















asked 8 hours ago









David G. StorkDavid G. Stork

26.3k2 gold badges24 silver badges59 bronze badges




26.3k2 gold badges24 silver badges59 bronze badges










  • 2




    $begingroup$
    Why don't you group the colour with the object? Cuboid[], Red, Sphere[].
    $endgroup$
    – Szabolcs
    8 hours ago











  • $begingroup$
    @Szabolcs: Yes, I can do that (+1), but I generate some figures algorithmically, and it gets a bit complicated to do this (though not impossible). Is there really no way to "cancel" a previous color specification? By analogy, one can "cancel" a Dashing specification with Dashing[None].
    $endgroup$
    – David G. Stork
    8 hours ago






  • 2




    $begingroup$
    I believe the default is White.
    $endgroup$
    – Szabolcs
    8 hours ago










  • $begingroup$
    @Szabolcs: Ah yes... helpful. I didn't think the default was White given the rendered colors. But this appears to work. (You can post this as a quick solution and I'll accept it.)
    $endgroup$
    – David G. Stork
    7 hours ago












  • 2




    $begingroup$
    Why don't you group the colour with the object? Cuboid[], Red, Sphere[].
    $endgroup$
    – Szabolcs
    8 hours ago











  • $begingroup$
    @Szabolcs: Yes, I can do that (+1), but I generate some figures algorithmically, and it gets a bit complicated to do this (though not impossible). Is there really no way to "cancel" a previous color specification? By analogy, one can "cancel" a Dashing specification with Dashing[None].
    $endgroup$
    – David G. Stork
    8 hours ago






  • 2




    $begingroup$
    I believe the default is White.
    $endgroup$
    – Szabolcs
    8 hours ago










  • $begingroup$
    @Szabolcs: Ah yes... helpful. I didn't think the default was White given the rendered colors. But this appears to work. (You can post this as a quick solution and I'll accept it.)
    $endgroup$
    – David G. Stork
    7 hours ago







2




2




$begingroup$
Why don't you group the colour with the object? Cuboid[], Red, Sphere[].
$endgroup$
– Szabolcs
8 hours ago





$begingroup$
Why don't you group the colour with the object? Cuboid[], Red, Sphere[].
$endgroup$
– Szabolcs
8 hours ago













$begingroup$
@Szabolcs: Yes, I can do that (+1), but I generate some figures algorithmically, and it gets a bit complicated to do this (though not impossible). Is there really no way to "cancel" a previous color specification? By analogy, one can "cancel" a Dashing specification with Dashing[None].
$endgroup$
– David G. Stork
8 hours ago




$begingroup$
@Szabolcs: Yes, I can do that (+1), but I generate some figures algorithmically, and it gets a bit complicated to do this (though not impossible). Is there really no way to "cancel" a previous color specification? By analogy, one can "cancel" a Dashing specification with Dashing[None].
$endgroup$
– David G. Stork
8 hours ago




2




2




$begingroup$
I believe the default is White.
$endgroup$
– Szabolcs
8 hours ago




$begingroup$
I believe the default is White.
$endgroup$
– Szabolcs
8 hours ago












$begingroup$
@Szabolcs: Ah yes... helpful. I didn't think the default was White given the rendered colors. But this appears to work. (You can post this as a quick solution and I'll accept it.)
$endgroup$
– David G. Stork
7 hours ago




$begingroup$
@Szabolcs: Ah yes... helpful. I didn't think the default was White given the rendered colors. But this appears to work. (You can post this as a quick solution and I'll accept it.)
$endgroup$
– David G. Stork
7 hours ago










1 Answer
1






active

oldest

votes


















6














$begingroup$

Graphics directives only persist inside the List that they are defined in`. So, use extra lists to control where the directives are active:



Graphics3D[Red, Sphere[], Cuboid[]]


enter image description here



Another possibility is to use Style wrappers:



Graphics3D[Style[Sphere[], Red], Cuboid[]]



same picture




Another possibility that is similar to your Dashing example is to use a rule :



Graphics3D[Red, Sphere[], FrontFaceColor->White, Cuboid[]]



same picture




In this case you can also just change the color back to white without a rule, e.g., Graphics3D[Red, Sphere[], White, Cuboid[]], but knowing about the rule possibility is useful.



You can examine what other rule possibilities there are by evaluating:



CurrentValue[StyleDefinitions, "Graphics3D"]



CellMargins -> 4, Inherited, Inherited, Inherited,
CellGroupingRules -> "GraphicsGrouping", StripStyleOnPaste -> False,
PageBreakWithin -> False, GeneratedCell -> True,
CellAutoOverwrite -> True, ShowCellLabel -> False,
DefaultFormatType -> DefaultOutputFormatType,
ContextMenu -> MenuItem["Cu&t Graphics Selection", "Cut"],
MenuItem["&Copy Graphics Selection", "Copy"],
MenuItem["&Paste into Graphic", FrontEnd`Paste[After]], Delimiter,
MenuItem["&Drawing Tools",
FrontEndExecute[FrontEnd`NotebookOpen[
FrontEnd`FindFileOnPath["DrawingTools.nb",
"PrivatePathsSystemResources"]]]],
MenuItem["&Get Coordinates",
FrontEndExecute[FrontEnd`Select2DTool["GetCoordinates"]]],
Delimiter, MenuItem["G&roup", "Group"],
MenuItem["&Ungroup", "Ungroup"], Delimiter,
MenuItem["Move to &Front", "MoveToFront"],
MenuItem["Move to &Back", "MoveToBack"],
MenuItem["Move For&ward", "MoveForward"],
MenuItem["Move Bac&kward", "MoveBackward"],
"AutoStyleOptionsHighlightMisspelledWords" -> False,
LanguageCategory -> "NaturalLanguage", FormatType -> StandardForm,
ShowStringCharacters -> False, NumberMarks -> False,
CounterIncrements -> "Graphics",
ImageMargins -> 43, Inherited, Inherited, 0,
Arrowheads -> 0.04, Dashing -> None, CapForm -> "Round",
JoinForm -> "Round", LineColor -> GrayLevel[0], LineOpacity -> 1,
EdgeColor -> GrayLevel[0], EdgeOpacity -> 1,
EdgeThickness -> Absolute[0.5], EdgeDashing -> None,
EdgeCapForm -> "Round", EdgeJoinForm -> "Round",
FrontFaceColor -> GrayLevel1, FrontFaceGlowColor -> GrayLevel[0],
FrontFaceSpecularColor -> GrayLevel[0],
FrontFaceSpecularExponent -> 1.5, BackFaceColor -> GrayLevel[1],
BackFaceGlowColor -> GrayLevel[0],
BackFaceSpecularColor -> GrayLevel[0],
BackFaceSpecularExponent -> 1.5, FrontFaceOpacity -> 1,
BackFaceOpacity -> 1, GraphicsColor -> GrayLevel[0],
PointSize -> Absolute[3], Thickness -> Absolute[0.5], Opacity -> 1,
DrawEdges -> True, DrawFrontFaces -> True, DrawBackFaces -> True,
StyleMenuListing -> None, FontFamily -> "Arial", FontSize -> 10,
FontWeight -> "Plain", FontColor -> GrayLevel[0], FontOpacity -> 1







share|improve this answer











$endgroup$














  • $begingroup$
    @CarlWolf: Yes, I can do that (+1), but I generate some figures algorithmically, and it gets a bit complicated to do this (though not impossible). Is there really no way to "cancel" a previous color specification? By analogy, one can "cancel" a Dashing specification with Dashing[None]. I believe one can "cancel" a previous EdgeForm with EdgeForm[Automatic].
    $endgroup$
    – David G. Stork
    8 hours ago







  • 1




    $begingroup$
    @DavidG.Stork See update.
    $endgroup$
    – Carl Woll
    7 hours ago












Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "387"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);














draft saved

draft discarded
















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f207125%2fcanceling-a-color-specification%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









6














$begingroup$

Graphics directives only persist inside the List that they are defined in`. So, use extra lists to control where the directives are active:



Graphics3D[Red, Sphere[], Cuboid[]]


enter image description here



Another possibility is to use Style wrappers:



Graphics3D[Style[Sphere[], Red], Cuboid[]]



same picture




Another possibility that is similar to your Dashing example is to use a rule :



Graphics3D[Red, Sphere[], FrontFaceColor->White, Cuboid[]]



same picture




In this case you can also just change the color back to white without a rule, e.g., Graphics3D[Red, Sphere[], White, Cuboid[]], but knowing about the rule possibility is useful.



You can examine what other rule possibilities there are by evaluating:



CurrentValue[StyleDefinitions, "Graphics3D"]



CellMargins -> 4, Inherited, Inherited, Inherited,
CellGroupingRules -> "GraphicsGrouping", StripStyleOnPaste -> False,
PageBreakWithin -> False, GeneratedCell -> True,
CellAutoOverwrite -> True, ShowCellLabel -> False,
DefaultFormatType -> DefaultOutputFormatType,
ContextMenu -> MenuItem["Cu&t Graphics Selection", "Cut"],
MenuItem["&Copy Graphics Selection", "Copy"],
MenuItem["&Paste into Graphic", FrontEnd`Paste[After]], Delimiter,
MenuItem["&Drawing Tools",
FrontEndExecute[FrontEnd`NotebookOpen[
FrontEnd`FindFileOnPath["DrawingTools.nb",
"PrivatePathsSystemResources"]]]],
MenuItem["&Get Coordinates",
FrontEndExecute[FrontEnd`Select2DTool["GetCoordinates"]]],
Delimiter, MenuItem["G&roup", "Group"],
MenuItem["&Ungroup", "Ungroup"], Delimiter,
MenuItem["Move to &Front", "MoveToFront"],
MenuItem["Move to &Back", "MoveToBack"],
MenuItem["Move For&ward", "MoveForward"],
MenuItem["Move Bac&kward", "MoveBackward"],
"AutoStyleOptionsHighlightMisspelledWords" -> False,
LanguageCategory -> "NaturalLanguage", FormatType -> StandardForm,
ShowStringCharacters -> False, NumberMarks -> False,
CounterIncrements -> "Graphics",
ImageMargins -> 43, Inherited, Inherited, 0,
Arrowheads -> 0.04, Dashing -> None, CapForm -> "Round",
JoinForm -> "Round", LineColor -> GrayLevel[0], LineOpacity -> 1,
EdgeColor -> GrayLevel[0], EdgeOpacity -> 1,
EdgeThickness -> Absolute[0.5], EdgeDashing -> None,
EdgeCapForm -> "Round", EdgeJoinForm -> "Round",
FrontFaceColor -> GrayLevel1, FrontFaceGlowColor -> GrayLevel[0],
FrontFaceSpecularColor -> GrayLevel[0],
FrontFaceSpecularExponent -> 1.5, BackFaceColor -> GrayLevel[1],
BackFaceGlowColor -> GrayLevel[0],
BackFaceSpecularColor -> GrayLevel[0],
BackFaceSpecularExponent -> 1.5, FrontFaceOpacity -> 1,
BackFaceOpacity -> 1, GraphicsColor -> GrayLevel[0],
PointSize -> Absolute[3], Thickness -> Absolute[0.5], Opacity -> 1,
DrawEdges -> True, DrawFrontFaces -> True, DrawBackFaces -> True,
StyleMenuListing -> None, FontFamily -> "Arial", FontSize -> 10,
FontWeight -> "Plain", FontColor -> GrayLevel[0], FontOpacity -> 1







share|improve this answer











$endgroup$














  • $begingroup$
    @CarlWolf: Yes, I can do that (+1), but I generate some figures algorithmically, and it gets a bit complicated to do this (though not impossible). Is there really no way to "cancel" a previous color specification? By analogy, one can "cancel" a Dashing specification with Dashing[None]. I believe one can "cancel" a previous EdgeForm with EdgeForm[Automatic].
    $endgroup$
    – David G. Stork
    8 hours ago







  • 1




    $begingroup$
    @DavidG.Stork See update.
    $endgroup$
    – Carl Woll
    7 hours ago















6














$begingroup$

Graphics directives only persist inside the List that they are defined in`. So, use extra lists to control where the directives are active:



Graphics3D[Red, Sphere[], Cuboid[]]


enter image description here



Another possibility is to use Style wrappers:



Graphics3D[Style[Sphere[], Red], Cuboid[]]



same picture




Another possibility that is similar to your Dashing example is to use a rule :



Graphics3D[Red, Sphere[], FrontFaceColor->White, Cuboid[]]



same picture




In this case you can also just change the color back to white without a rule, e.g., Graphics3D[Red, Sphere[], White, Cuboid[]], but knowing about the rule possibility is useful.



You can examine what other rule possibilities there are by evaluating:



CurrentValue[StyleDefinitions, "Graphics3D"]



CellMargins -> 4, Inherited, Inherited, Inherited,
CellGroupingRules -> "GraphicsGrouping", StripStyleOnPaste -> False,
PageBreakWithin -> False, GeneratedCell -> True,
CellAutoOverwrite -> True, ShowCellLabel -> False,
DefaultFormatType -> DefaultOutputFormatType,
ContextMenu -> MenuItem["Cu&t Graphics Selection", "Cut"],
MenuItem["&Copy Graphics Selection", "Copy"],
MenuItem["&Paste into Graphic", FrontEnd`Paste[After]], Delimiter,
MenuItem["&Drawing Tools",
FrontEndExecute[FrontEnd`NotebookOpen[
FrontEnd`FindFileOnPath["DrawingTools.nb",
"PrivatePathsSystemResources"]]]],
MenuItem["&Get Coordinates",
FrontEndExecute[FrontEnd`Select2DTool["GetCoordinates"]]],
Delimiter, MenuItem["G&roup", "Group"],
MenuItem["&Ungroup", "Ungroup"], Delimiter,
MenuItem["Move to &Front", "MoveToFront"],
MenuItem["Move to &Back", "MoveToBack"],
MenuItem["Move For&ward", "MoveForward"],
MenuItem["Move Bac&kward", "MoveBackward"],
"AutoStyleOptionsHighlightMisspelledWords" -> False,
LanguageCategory -> "NaturalLanguage", FormatType -> StandardForm,
ShowStringCharacters -> False, NumberMarks -> False,
CounterIncrements -> "Graphics",
ImageMargins -> 43, Inherited, Inherited, 0,
Arrowheads -> 0.04, Dashing -> None, CapForm -> "Round",
JoinForm -> "Round", LineColor -> GrayLevel[0], LineOpacity -> 1,
EdgeColor -> GrayLevel[0], EdgeOpacity -> 1,
EdgeThickness -> Absolute[0.5], EdgeDashing -> None,
EdgeCapForm -> "Round", EdgeJoinForm -> "Round",
FrontFaceColor -> GrayLevel1, FrontFaceGlowColor -> GrayLevel[0],
FrontFaceSpecularColor -> GrayLevel[0],
FrontFaceSpecularExponent -> 1.5, BackFaceColor -> GrayLevel[1],
BackFaceGlowColor -> GrayLevel[0],
BackFaceSpecularColor -> GrayLevel[0],
BackFaceSpecularExponent -> 1.5, FrontFaceOpacity -> 1,
BackFaceOpacity -> 1, GraphicsColor -> GrayLevel[0],
PointSize -> Absolute[3], Thickness -> Absolute[0.5], Opacity -> 1,
DrawEdges -> True, DrawFrontFaces -> True, DrawBackFaces -> True,
StyleMenuListing -> None, FontFamily -> "Arial", FontSize -> 10,
FontWeight -> "Plain", FontColor -> GrayLevel[0], FontOpacity -> 1







share|improve this answer











$endgroup$














  • $begingroup$
    @CarlWolf: Yes, I can do that (+1), but I generate some figures algorithmically, and it gets a bit complicated to do this (though not impossible). Is there really no way to "cancel" a previous color specification? By analogy, one can "cancel" a Dashing specification with Dashing[None]. I believe one can "cancel" a previous EdgeForm with EdgeForm[Automatic].
    $endgroup$
    – David G. Stork
    8 hours ago







  • 1




    $begingroup$
    @DavidG.Stork See update.
    $endgroup$
    – Carl Woll
    7 hours ago













6














6










6







$begingroup$

Graphics directives only persist inside the List that they are defined in`. So, use extra lists to control where the directives are active:



Graphics3D[Red, Sphere[], Cuboid[]]


enter image description here



Another possibility is to use Style wrappers:



Graphics3D[Style[Sphere[], Red], Cuboid[]]



same picture




Another possibility that is similar to your Dashing example is to use a rule :



Graphics3D[Red, Sphere[], FrontFaceColor->White, Cuboid[]]



same picture




In this case you can also just change the color back to white without a rule, e.g., Graphics3D[Red, Sphere[], White, Cuboid[]], but knowing about the rule possibility is useful.



You can examine what other rule possibilities there are by evaluating:



CurrentValue[StyleDefinitions, "Graphics3D"]



CellMargins -> 4, Inherited, Inherited, Inherited,
CellGroupingRules -> "GraphicsGrouping", StripStyleOnPaste -> False,
PageBreakWithin -> False, GeneratedCell -> True,
CellAutoOverwrite -> True, ShowCellLabel -> False,
DefaultFormatType -> DefaultOutputFormatType,
ContextMenu -> MenuItem["Cu&t Graphics Selection", "Cut"],
MenuItem["&Copy Graphics Selection", "Copy"],
MenuItem["&Paste into Graphic", FrontEnd`Paste[After]], Delimiter,
MenuItem["&Drawing Tools",
FrontEndExecute[FrontEnd`NotebookOpen[
FrontEnd`FindFileOnPath["DrawingTools.nb",
"PrivatePathsSystemResources"]]]],
MenuItem["&Get Coordinates",
FrontEndExecute[FrontEnd`Select2DTool["GetCoordinates"]]],
Delimiter, MenuItem["G&roup", "Group"],
MenuItem["&Ungroup", "Ungroup"], Delimiter,
MenuItem["Move to &Front", "MoveToFront"],
MenuItem["Move to &Back", "MoveToBack"],
MenuItem["Move For&ward", "MoveForward"],
MenuItem["Move Bac&kward", "MoveBackward"],
"AutoStyleOptionsHighlightMisspelledWords" -> False,
LanguageCategory -> "NaturalLanguage", FormatType -> StandardForm,
ShowStringCharacters -> False, NumberMarks -> False,
CounterIncrements -> "Graphics",
ImageMargins -> 43, Inherited, Inherited, 0,
Arrowheads -> 0.04, Dashing -> None, CapForm -> "Round",
JoinForm -> "Round", LineColor -> GrayLevel[0], LineOpacity -> 1,
EdgeColor -> GrayLevel[0], EdgeOpacity -> 1,
EdgeThickness -> Absolute[0.5], EdgeDashing -> None,
EdgeCapForm -> "Round", EdgeJoinForm -> "Round",
FrontFaceColor -> GrayLevel1, FrontFaceGlowColor -> GrayLevel[0],
FrontFaceSpecularColor -> GrayLevel[0],
FrontFaceSpecularExponent -> 1.5, BackFaceColor -> GrayLevel[1],
BackFaceGlowColor -> GrayLevel[0],
BackFaceSpecularColor -> GrayLevel[0],
BackFaceSpecularExponent -> 1.5, FrontFaceOpacity -> 1,
BackFaceOpacity -> 1, GraphicsColor -> GrayLevel[0],
PointSize -> Absolute[3], Thickness -> Absolute[0.5], Opacity -> 1,
DrawEdges -> True, DrawFrontFaces -> True, DrawBackFaces -> True,
StyleMenuListing -> None, FontFamily -> "Arial", FontSize -> 10,
FontWeight -> "Plain", FontColor -> GrayLevel[0], FontOpacity -> 1







share|improve this answer











$endgroup$



Graphics directives only persist inside the List that they are defined in`. So, use extra lists to control where the directives are active:



Graphics3D[Red, Sphere[], Cuboid[]]


enter image description here



Another possibility is to use Style wrappers:



Graphics3D[Style[Sphere[], Red], Cuboid[]]



same picture




Another possibility that is similar to your Dashing example is to use a rule :



Graphics3D[Red, Sphere[], FrontFaceColor->White, Cuboid[]]



same picture




In this case you can also just change the color back to white without a rule, e.g., Graphics3D[Red, Sphere[], White, Cuboid[]], but knowing about the rule possibility is useful.



You can examine what other rule possibilities there are by evaluating:



CurrentValue[StyleDefinitions, "Graphics3D"]



CellMargins -> 4, Inherited, Inherited, Inherited,
CellGroupingRules -> "GraphicsGrouping", StripStyleOnPaste -> False,
PageBreakWithin -> False, GeneratedCell -> True,
CellAutoOverwrite -> True, ShowCellLabel -> False,
DefaultFormatType -> DefaultOutputFormatType,
ContextMenu -> MenuItem["Cu&t Graphics Selection", "Cut"],
MenuItem["&Copy Graphics Selection", "Copy"],
MenuItem["&Paste into Graphic", FrontEnd`Paste[After]], Delimiter,
MenuItem["&Drawing Tools",
FrontEndExecute[FrontEnd`NotebookOpen[
FrontEnd`FindFileOnPath["DrawingTools.nb",
"PrivatePathsSystemResources"]]]],
MenuItem["&Get Coordinates",
FrontEndExecute[FrontEnd`Select2DTool["GetCoordinates"]]],
Delimiter, MenuItem["G&roup", "Group"],
MenuItem["&Ungroup", "Ungroup"], Delimiter,
MenuItem["Move to &Front", "MoveToFront"],
MenuItem["Move to &Back", "MoveToBack"],
MenuItem["Move For&ward", "MoveForward"],
MenuItem["Move Bac&kward", "MoveBackward"],
"AutoStyleOptionsHighlightMisspelledWords" -> False,
LanguageCategory -> "NaturalLanguage", FormatType -> StandardForm,
ShowStringCharacters -> False, NumberMarks -> False,
CounterIncrements -> "Graphics",
ImageMargins -> 43, Inherited, Inherited, 0,
Arrowheads -> 0.04, Dashing -> None, CapForm -> "Round",
JoinForm -> "Round", LineColor -> GrayLevel[0], LineOpacity -> 1,
EdgeColor -> GrayLevel[0], EdgeOpacity -> 1,
EdgeThickness -> Absolute[0.5], EdgeDashing -> None,
EdgeCapForm -> "Round", EdgeJoinForm -> "Round",
FrontFaceColor -> GrayLevel1, FrontFaceGlowColor -> GrayLevel[0],
FrontFaceSpecularColor -> GrayLevel[0],
FrontFaceSpecularExponent -> 1.5, BackFaceColor -> GrayLevel[1],
BackFaceGlowColor -> GrayLevel[0],
BackFaceSpecularColor -> GrayLevel[0],
BackFaceSpecularExponent -> 1.5, FrontFaceOpacity -> 1,
BackFaceOpacity -> 1, GraphicsColor -> GrayLevel[0],
PointSize -> Absolute[3], Thickness -> Absolute[0.5], Opacity -> 1,
DrawEdges -> True, DrawFrontFaces -> True, DrawBackFaces -> True,
StyleMenuListing -> None, FontFamily -> "Arial", FontSize -> 10,
FontWeight -> "Plain", FontColor -> GrayLevel[0], FontOpacity -> 1








share|improve this answer














share|improve this answer



share|improve this answer








edited 7 hours ago

























answered 8 hours ago









Carl WollCarl Woll

91.4k3 gold badges121 silver badges233 bronze badges




91.4k3 gold badges121 silver badges233 bronze badges














  • $begingroup$
    @CarlWolf: Yes, I can do that (+1), but I generate some figures algorithmically, and it gets a bit complicated to do this (though not impossible). Is there really no way to "cancel" a previous color specification? By analogy, one can "cancel" a Dashing specification with Dashing[None]. I believe one can "cancel" a previous EdgeForm with EdgeForm[Automatic].
    $endgroup$
    – David G. Stork
    8 hours ago







  • 1




    $begingroup$
    @DavidG.Stork See update.
    $endgroup$
    – Carl Woll
    7 hours ago
















  • $begingroup$
    @CarlWolf: Yes, I can do that (+1), but I generate some figures algorithmically, and it gets a bit complicated to do this (though not impossible). Is there really no way to "cancel" a previous color specification? By analogy, one can "cancel" a Dashing specification with Dashing[None]. I believe one can "cancel" a previous EdgeForm with EdgeForm[Automatic].
    $endgroup$
    – David G. Stork
    8 hours ago







  • 1




    $begingroup$
    @DavidG.Stork See update.
    $endgroup$
    – Carl Woll
    7 hours ago















$begingroup$
@CarlWolf: Yes, I can do that (+1), but I generate some figures algorithmically, and it gets a bit complicated to do this (though not impossible). Is there really no way to "cancel" a previous color specification? By analogy, one can "cancel" a Dashing specification with Dashing[None]. I believe one can "cancel" a previous EdgeForm with EdgeForm[Automatic].
$endgroup$
– David G. Stork
8 hours ago





$begingroup$
@CarlWolf: Yes, I can do that (+1), but I generate some figures algorithmically, and it gets a bit complicated to do this (though not impossible). Is there really no way to "cancel" a previous color specification? By analogy, one can "cancel" a Dashing specification with Dashing[None]. I believe one can "cancel" a previous EdgeForm with EdgeForm[Automatic].
$endgroup$
– David G. Stork
8 hours ago





1




1




$begingroup$
@DavidG.Stork See update.
$endgroup$
– Carl Woll
7 hours ago




$begingroup$
@DavidG.Stork See update.
$endgroup$
– Carl Woll
7 hours ago


















draft saved

draft discarded















































Thanks for contributing an answer to Mathematica Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

Use MathJax to format equations. MathJax reference.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f207125%2fcanceling-a-color-specification%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Invision Community Contents History See also References External links Navigation menuProprietaryinvisioncommunity.comIPS Community ForumsIPS Community Forumsthis blog entry"License Changes, IP.Board 3.4, and the Future""Interview -- Matt Mecham of Ibforums""CEO Invision Power Board, Matt Mecham Is a Liar, Thief!"IPB License Explanation 1.3, 1.3.1, 2.0, and 2.1ArchivedSecurity Fixes, Updates And Enhancements For IPB 1.3.1Archived"New Demo Accounts - Invision Power Services"the original"New Default Skin"the original"Invision Power Board 3.0.0 and Applications Released"the original"Archived copy"the original"Perpetual licenses being done away with""Release Notes - Invision Power Services""Introducing: IPS Community Suite 4!"Invision Community Release Notes

199年 目錄 大件事 到箇年出世嗰人 到箇年死嗰人 節慶、風俗習慣 導覽選單