Learn to Code : Membuat simulasi warna RGB (Red – Green – Blue) pada powerpoint

Pada posting kali ini, akan dijelaskan bagaimana membuat simulasi warna RGB (Red – Green – Blue) pada powerpoint menggunakan visual basic for application.

download : video tutorial membuat simulasi warna RGB

Script VBA untuk membuat simulasi warna RGB

Private Sub SpinButton1_Change()
ActivePresentation.Slides(1).Shapes(“kotakRGB”).Fill.BackColor.RGB = RGB(Val(SpinButton1), Val(SpinButton2), Val(SpinButton3))
ActivePresentation.Slides(1).Shapes(“kotakRGB”).Fill.ForeColor.RGB = RGB(Val(SpinButton1), Val(SpinButton2), Val(SpinButton3))
ActivePresentation.Slides(1).Shapes(“kotakRed”).Fill.BackColor.RGB = RGB(Val(SpinButton1), 0, 0)
ActivePresentation.Slides(1).Shapes(“kotakRed”).Fill.ForeColor.RGB = RGB(Val(SpinButton1), 0, 0)
ActivePresentation.Slides(1).Shapes(“angkaRed”).TextFrame.TextRange.Text = Val(SpinButton1)
End Sub

Private Sub SpinButton2_Change()
ActivePresentation.Slides(1).Shapes(“kotakRGB”).Fill.BackColor.RGB = RGB(Val(SpinButton1), Val(SpinButton2), Val(SpinButton3))
ActivePresentation.Slides(1).Shapes(“kotakRGB”).Fill.ForeColor.RGB = RGB(Val(SpinButton1), Val(SpinButton2), Val(SpinButton3))
ActivePresentation.Slides(1).Shapes(“kotakGreen”).Fill.BackColor.RGB = RGB(0, Val(SpinButton2), 0)
ActivePresentation.Slides(1).Shapes(“kotakGreen”).Fill.ForeColor.RGB = RGB(0, Val(SpinButton2), 0)
ActivePresentation.Slides(1).Shapes(“angkaGreen”).TextFrame.TextRange.Text = Val(SpinButton2)
End Sub

Private Sub SpinButton3_Change()
ActivePresentation.Slides(1).Shapes(“kotakRGB”).Fill.BackColor.RGB = RGB(Val(SpinButton1), Val(SpinButton2), Val(SpinButton3))
ActivePresentation.Slides(1).Shapes(“kotakRGB”).Fill.ForeColor.RGB = RGB(Val(SpinButton1), Val(SpinButton2), Val(SpinButton3))
ActivePresentation.Slides(1).Shapes(“kotakBlue”).Fill.BackColor.RGB = RGB(0, 0, Val(SpinButton3))
ActivePresentation.Slides(1).Shapes(“kotakBlue”).Fill.ForeColor.RGB = RGB(0, 0, Val(SpinButton3))
ActivePresentation.Slides(1).Shapes(“angkaBlue”).TextFrame.TextRange.Text = Val(SpinButton3)
End Sub

download : file latihan membuat simulasi warna RGB

 

Author: Abdul Karim

Integrasi Matematika dan Teknologi merupakan fokus perhatian saya, dalam memberikan kontribusi kepada pendidikan matematika di Indonesi

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s