You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This idea spawned from discord messages about adding support for additional color palletes and how it is not that easy to use/find those that already are in.
This is rough draft of model that could hold color information and transfer it to internal format only when needed first time (decreasing Construction calls at import for colors which will never used for individual animation).
In Addittion, global namespace can be much cleaner if there is not floating all default colors like RED, WHITE, BLACK, etc.
# IDE see this information:classAS2700_UI():
Y14_GOLDEN_YELLOW:ManimColor="#DDDDDD"#could also be only with annotationB13_NAVY_BLUE : ManimColorDICTIONARY= {
"Y14_GOLDEN_YELLOW": "GOLDEN YELLOW",
}
# Runtime sees instances of this class:classColorBuilder:
def__init__(self, dictionary:dict) ->None:
self.dictionary=dictionarydef__getattr__(self, name: str) ->Any:
item=self.dictionary.get(name, "DEFAULT")
# Calls transformer to internal color formatcolor_object=ManimColor(item)
#builds proper attribute, so next call returns color_object directlysetattr(self, name, color_object)
returncolor_object#namespace substitution at import:AS2700_UI=ColorBuilder(AS2700_API.DICTIONARY)
# Global namespace could start Colors, ColorsX11, etc.# Or PalletteColorsAS2700=AS2700_UIPalletteAS2700=AS2700_UI
How can the new feature be used?
#end user call:yellow=ColorAS2700.Y14_GOLDEN_YELLOW#or:colors=ColorAS2700colors=PalletteAS2700yellow=colors.Y14_GOLDEN_YELLOW
The text was updated successfully, but these errors were encountered:
OliverStrait
added
the
new feature
Enhancement specifically adding a new feature (feature request should be used for issues instead)
label
Aug 20, 2024
OliverStrait
changed the title
Color palet format and builder
Color palette format and builder
Aug 21, 2024
Description of proposed feature
This idea spawned from discord messages about adding support for additional color palletes and how it is not that easy to use/find those that already are in.
This is rough draft of model that could hold color information and transfer it to internal format only when needed first time (decreasing Construction calls at import for colors which will never used for individual animation).
In Addittion, global namespace can be much cleaner if there is not floating all default colors like RED, WHITE, BLACK, etc.
How can the new feature be used?
The text was updated successfully, but these errors were encountered: