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;
$begingroup$
I can get the default colors for one figure (Cuboid), and then color another figure (Sphere), as here:
Graphics3D[
Cuboid[],
Red, Sphere[]
]
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
$endgroup$
add a comment
|
$begingroup$
I can get the default colors for one figure (Cuboid), and then color another figure (Sphere), as here:
Graphics3D[
Cuboid[],
Red, Sphere[]
]
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
$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" aDashing
specification withDashing[None]
.
$endgroup$
– David G. Stork
8 hours ago
2
$begingroup$
I believe the default isWhite
.
$endgroup$
– Szabolcs
8 hours ago
$begingroup$
@Szabolcs: Ah yes... helpful. I didn't think the default wasWhite
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
add a comment
|
$begingroup$
I can get the default colors for one figure (Cuboid), and then color another figure (Sphere), as here:
Graphics3D[
Cuboid[],
Red, Sphere[]
]
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
$endgroup$
I can get the default colors for one figure (Cuboid), and then color another figure (Sphere), as here:
Graphics3D[
Cuboid[],
Red, Sphere[]
]
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
color faceform
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" aDashing
specification withDashing[None]
.
$endgroup$
– David G. Stork
8 hours ago
2
$begingroup$
I believe the default isWhite
.
$endgroup$
– Szabolcs
8 hours ago
$begingroup$
@Szabolcs: Ah yes... helpful. I didn't think the default wasWhite
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
add a comment
|
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" aDashing
specification withDashing[None]
.
$endgroup$
– David G. Stork
8 hours ago
2
$begingroup$
I believe the default isWhite
.
$endgroup$
– Szabolcs
8 hours ago
$begingroup$
@Szabolcs: Ah yes... helpful. I didn't think the default wasWhite
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
add a comment
|
1 Answer
1
active
oldest
votes
$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[]]
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
$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" aDashing
specification withDashing[None]
. I believe one can "cancel" a previousEdgeForm
withEdgeForm[Automatic]
.
$endgroup$
– David G. Stork
8 hours ago
1
$begingroup$
@DavidG.Stork See update.
$endgroup$
– Carl Woll
7 hours ago
add a comment
|
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
$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[]]
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
$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" aDashing
specification withDashing[None]
. I believe one can "cancel" a previousEdgeForm
withEdgeForm[Automatic]
.
$endgroup$
– David G. Stork
8 hours ago
1
$begingroup$
@DavidG.Stork See update.
$endgroup$
– Carl Woll
7 hours ago
add a comment
|
$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[]]
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
$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" aDashing
specification withDashing[None]
. I believe one can "cancel" a previousEdgeForm
withEdgeForm[Automatic]
.
$endgroup$
– David G. Stork
8 hours ago
1
$begingroup$
@DavidG.Stork See update.
$endgroup$
– Carl Woll
7 hours ago
add a comment
|
$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[]]
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
$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[]]
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
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" aDashing
specification withDashing[None]
. I believe one can "cancel" a previousEdgeForm
withEdgeForm[Automatic]
.
$endgroup$
– David G. Stork
8 hours ago
1
$begingroup$
@DavidG.Stork See update.
$endgroup$
– Carl Woll
7 hours ago
add a comment
|
$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" aDashing
specification withDashing[None]
. I believe one can "cancel" a previousEdgeForm
withEdgeForm[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
add a comment
|
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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 withDashing[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