Sideway
output.to from Sideway
`-=[]โŸจโŸฉ\;',./~!@#$%^&*()_+{}|:"<>? ๐‘Ž๐‘๐‘๐‘‘๐‘’๐‘“๐‘”โ„Ž๐‘–๐‘—๐‘˜๐‘™๐‘š๐‘›๐‘œ๐‘๐‘ž๐‘Ÿ๐‘ ๐‘ก๐‘ข๐‘ฃ๐‘ค๐‘ฅ๐‘ฆ๐‘ง ร…โ€‰โˆ’โ€‚ร—โ€ƒโ‹…โˆ“ยฑโˆ˜๊žŠ๏นฆโˆ—โˆ™ โ„ฏ ๐”ธ๐”นโ„‚๐”ป๐”ผ๐”ฝ๐”พโ„๐•€๐•๐•‚๐•ƒ๐•„โ„•๐•†โ„™โ„šโ„๐•Š๐•‹๐•Œ๐•๐•Ž๐•๐•โ„ค๐ด๐ต๐ถ๐ท๐ธ๐น๐บ๐ป๐ผ๐ฝ๐พ๐ฟ๐‘€๐‘๐‘‚๐‘ƒ๐‘„๐‘…๐‘†๐‘‡๐‘ˆ๐‘‰๐‘Š๐‘‹๐‘Œ๐‘ โˆผโˆฝโˆพโ‰โ‰‚โ‰ƒโ‰„โ‰…โ‰†โ‰‡โ‰ˆโ‰‰โ‰Œโ‰โ‰ โ‰ก โ‰คโ‰ฅโ‰ฆโ‰งโ‰จโ‰ฉโ‰ชโ‰ซ โˆˆโˆ‰โˆŠโˆ‹โˆŒโˆ โŠ‚โŠƒโŠ„โŠ…โІโЇ ๐›ผ๐›ฝ๐›พ๐›ฟ๐œ€๐œ๐œ‚๐œƒ๐œ„๐œ…๐œ†๐œ‡๐œˆ๐œ‰๐œŠ๐œ‹๐œŒ๐œŽ๐œ๐œ๐œ‘๐œ’๐œ“๐œ” โˆ€โˆ‚โˆƒโˆ…โฆฐโˆ†โˆ‡โˆŽโˆžโˆโˆดโˆต โˆโˆโˆ‘โ‹€โ‹โ‹‚โ‹ƒ โˆงโˆจโˆฉโˆช โˆซโˆฌโˆญโˆฎโˆฏโˆฐโˆฑโˆฒโˆณ โˆฅโ‹ฎโ‹ฏโ‹ฐโ‹ฑ โ€– โ€ฒ โ€ณ โ€ด โ„ โ— สน สบ โ€ต โ€ถ โ€ท ๏น ๏น‚ ๏นƒ ๏น„ ๏ธน ๏ธบ ๏ธป ๏ธผ ๏ธ— ๏ธ˜ ๏ธฟ ๏น€ ๏ธฝ ๏ธพ ๏น‡ ๏นˆ ๏ธท ๏ธธ โœ   โ   โŽด  โŽต  โž   โŸ   โ    โก โ†โ†‘โ†’โ†“โ†คโ†ฆโ†ฅโ†งโ†”โ†•โ†–โ†—โ†˜โ†™โ–ฒโ–ผโ—€โ–ถโ†บโ†ปโŸฒโŸณ โ†ผโ†ฝโ†พโ†ฟโ‡€โ‡โ‡‚โ‡ƒโ‡„โ‡…โ‡†โ‡‡ โ‡โ‡‘โ‡’โ‡“โ‡”โ‡Œโ‡โ‡โ‡•โ‡–โ‡—โ‡˜โ‡™โ‡™โ‡ณโฅขโฅฃโฅคโฅฅโฅฆโฅงโฅจโฅฉโฅชโฅซโฅฌโฅญโฅฎโฅฏ
Draft for Information Only

Content

Mobject
โ€ƒColoring Functions
โ€ƒโ€ƒdef set_color(self, color=YELLOW_C, family=True)
โ€ƒโ€ƒdef set_color_by_gradient(self, *colors)
โ€ƒโ€ƒdef set_colors_by_radial_gradient(self, center=None, radius=1, inner_color=WHITE, outer_color=BLACK)
โ€ƒโ€ƒdef set_submobject_colors_by_gradient(self, *colors)
โ€ƒโ€ƒdef set_submobject_colors_by_radial_gradient(self, center=None, radius=1, inner_color=WHITE, outer_color=BLACK)
โ€ƒโ€ƒdef to_original_color(self)
โ€ƒโ€ƒdef fade_to(self, color, alpha, family=True)
โ€ƒโ€ƒdef fade(self, darkness=0.5, family=True)
โ€ƒโ€ƒโ€ƒExample
โ€ƒโ€ƒโ€ƒโ€ƒCode
โ€ƒโ€ƒโ€ƒโ€ƒOutput

Mobject

The defined coloring functions for Mobject in mobject.py
  • def set_color(self, color=YELLOW_C, family=True)
  • def set_color_by_gradient(self, *colors)
  • def set_colors_by_radial_gradient(self, center=None, radius=1, inner_color=WHITE, outer_color=BLACK)
  • def set_submobject_colors_by_gradient(self, *colors)
  • def set_submobject_colors_by_radial_gradient(self, center=None, radius=1, inner_color=WHITE, outer_color=BLACK)
  • def to_original_color(self)
  • def fade_to(self, color, alpha, family=True)
  • def fade(self, darkness=0.5, family=True)

Coloring Functions

def set_color(self, color=YELLOW_C, family=True)

set_color is used to set the color of a Mobject according to the specified parameters.

def set_color_by_gradient(self, *colors)

set_color_by_gradient is used to set the color of a Mobject by gradient according to the specified colors parameters, *color.

def set_colors_by_radial_gradient(self, center=None, radius=1, inner_color=WHITE, outer_color=BLACK)

set_colors_by_radial_gradient is used to set the color of a Mobject by gradient radially according to the specified parameters.

def set_submobject_colors_by_gradient(self, *colors)

set_submobject_colors_by_gradient is used to set subMobject colors by gradient according to the specified parameters.

def set_submobject_colors_by_radial_gradient(self, center=None, radius=1, inner_color=WHITE, outer_color=BLACK)

set_submobject_colors_by_radial_gradient is used to set subMobject colors by gradient radially according to the specified parameters.

def to_original_color(self)

to_original_color is used to set the color of a Mobject to its original color.

def fade_to(self, color, alpha, family=True)

fade_to is used to set the color of a Mobject by fading to according to the specified color parameter, color, and the specified alpha parameter, alpha.

def fade(self, darkness=0.5, family=True)

fade is used to set the color of a Mobject by fading according to the specified parameters.

Example

Code
# folder/file: tut/manim_mobject_func_coloring_001a.py

from manimlib.scene.scene import Scene
from manimlib.mobject.geometry import Rectangle, Square, Circle, Line,RoundedRectangle
from manimlib.animation.creation import ShowCreation
from manimlib.mobject.svg.tex_mobject import TexMobject, TextMobject
from manimlib.animation.fading import FadeOut
from manimlib.animation.creation import Write
from manimlib.animation.transform import ApplyMethod, ApplyFunction
from manimlib.imports import *
class manim_mobject_func_coloring_001a(Scene): 
   def construct(self):
      linex=Line([2,2,0],[1,1,0],color="#88FF00")
      polya= RoundedRectangle(width=2,height=2,corner_radius=0.5,stroke_width=50,fill_color="#FFFF00",fill_opacity=1)
      polyb = Rectangle(width=2.5,height=1.5,stroke_width=15,color="#88FF00",fill_color="#FFFF00",fill_opacity=1)
      polyc= Square(side_length=2,stroke_width=20,fill_color="#FF8800",fill_opacity=1).move_to([-3,-2,0])
      polyd= Circle(arc_center=(-2,0.75,0),color="#888888")
      polya.add(Rectangle(width=2,height=2,color="#77DDCC").move_to(polya))
      polya.add(Rectangle(width=1,height=2.5,color="#77DDCC").move_to(polya))
      polya.add(TextMobject("A").move_to(polya))
      polye = Rectangle(width=1.25,height=3.75,color="#888888",fill_color="#333333",fill_opacity=1).move_to([-0.625,-1.125,0])
      polyf= Rectangle(width=1,height=2,color="#888888").move_to([-2.5,-2,0])
      self.play(ShowCreation(polyb),run_time=2)
      polyb.add(polye)
      #self.play(ShowCreation(polyb),ShowCreation(polye),run_time=2)
      self.wait()
      self.play(ShowCreation(polyc),ShowCreation(polyf),run_time=2)
      self.wait()
      self.play(ShowCreation(polya.move_to(polyd)),ShowCreation(polyd),run_time=2)
      self.wait()
      self.add(TextMobject("B").move_to([0,0,0]))
      self.add(TextMobject("C").move_to(polyc))
      self.add(TextMobject("E").move_to(polye))
      self.add(linex)
      self.add(Rectangle(width=14.22,height=8))
      text=TexMobject("polya.set\_color(color=\"\#338833\")").move_to([0,3,0])
      self.play(Write(text),ApplyFunction(lambda mob:mob.set_color(color="#338833"),polya),run_time=3)
      self.wait()
      self.play(FadeOut(text),run_time=2)
      text=TexMobject("polya.set\_color\_by\_gradient(\"\#FF8833\",\"\#003388\")").move_to([0,3,0])
      self.play(Write(text),ApplyFunction(lambda mob:mob.set_color_by_gradient("#FF8833","#003388"),polya),run_time=3)
      self.wait()
      self.play(FadeOut(text),run_time=2)
      text=TexMobject("text.set\_color\_by\_radial\_gradient\cr(radius=2,outer_color=\"\#003388\")").move_to([0,3,0])
      self.play(ApplyFunction(lambda mob:mob.set_colors_by_radial_gradient( radius=2,outer_color="#003388"),text),run_time=5)
      self.wait()
      self.play(FadeOut(text),run_time=2)
      text=TexMobject("polya.to\_original\_color()").move_to([0,3,0])
      self.play(Write(text),ApplyFunction(lambda mob:mob.to_original_color(),polya),run_time=3)
      self.wait()
      self.play(FadeOut(text),run_time=2)
      text=TexMobject("text.set\_submobject\_color\_by\_gradient\cr(\"\#FF8833\",\"\#003388\")").move_to([0,3,0])
      self.play(ApplyFunction(lambda mob:mob.set_submobject_colors_by_gradient("#FF8833","#003388"),text),run_time=3)
      self.wait()
      self.play(FadeOut(text),run_time=2)
      text=TexMobject("text.set\_submobject\_color\\_by\_radial\_gradient\cr(radius=2,outer_color=\"\#003388\")").move_to([0,3,0])
      self.play(ApplyFunction(lambda mob:mob.set_submobject_colors_by_radial_gradient( radius=2,outer_color="#003388"),text),run_time=5)
      self.wait()
      self.play(FadeOut(text),run_time=2)
      text=TexMobject("polya.fade\_to(color=\"\#003388\",alpha=0.75)").move_to([0,3,0])
      self.play(Write(text),ApplyFunction(lambda mob:mob.fade_to(color="#003388",alpha=0.75),polya),run_time=3)
      self.wait()
      self.play(FadeOut(text),run_time=2)
      text=TexMobject("polyb.fade()").move_to([0,3,0])
      self.play(Write(text),ApplyFunction(lambda mob:mob.fade(),polyb),run_time=3)
      self.wait()
      self.play(FadeOut(text),run_time=2)
Output
image

ยฉsideway

ID: 200301502 Last Updated: 3/15/2020 Revision: 0


Latest Updated LinksValid XHTML 1.0 Transitional Valid CSS!Nu Html Checker Firefox53 Chromena IExplorerna
IMAGE

Home 5

Business

Management

HBR 3

Information

Recreation

Hobbies 9

Culture

Chinese 1097

English 339

Travel 38

Reference 79

Hardware 55

Computer

Hardware 259

Software

Application 213

Digitization 37

Latex 52

Manim 205

KB 1

Numeric 19

Programming

Web 290new

Unicode 504

HTML 66new

Common Color 1new

Html Entity (Unicode) 1new

Html 401 Special 1

CSS 65new

Selector 1

SVG 46

ASP.NET 270

OS 447new

MS Windows

Windows10 1new

.NET Framework 1

DeskTop 7

Python 72

Knowledge

Mathematics

Formulas 8

Set 1

Logic 1

Algebra 84

Number Theory 207new

Trigonometry 31

Geometry 34

Coordinate Geometry 2

Calculus 67

Complex Analysis 21

Engineering

Tables 8

Mechanical

Mechanics 1

Rigid Bodies

Statics 92

Dynamics 37

Fluid 5

Fluid Kinematics 5

Control

Process Control 1

Acoustics 19

FiniteElement 2

Natural Sciences

Matter 1

Electric 27

Biology 1

Geography 1


Copyright © 2000-2026 Sideway . All rights reserved Disclaimers last modified on 06 September 2019