SlideShare a Scribd company logo
1 of 19
Grafika Komputer
Mewarnai Object
Mohammad Faried Rahmat., S.ST., M.Tr.T
Teknik Informatika
Universitas Islam Balitar
Kita akan Mempelajari
• Fungsi Backgroud
• Fungsi Fill
• Fungsi Stroke
• Contoh Kasus
Background
• Untuk memberikan warna pada background
• Struktur – RGB
• Background(125) = background Abu abu
• Background(0) = Hitam
• Background(255) = putih
Referensi Warna
• Untuk mencari referensi warna silahkan cari di google dengan kata
kunci : color picker
Link Referensi Warna
• https://www.niagahoster.co.id/blog/daftar-kode-warna-pada-html/
• https://qwords.com/blog/kode-warna-html-lengkap/
Praktek 1 - Background
function setup() {
createCanvas(200, 200);
}
function draw() {
background(0);
}
Praktek 2 - Background RGB
function setup() {
createCanvas(200, 200);
}
function draw() {
background(252, 61, 224);
}
Fungsi Fill
• Untuk mewarnai isi dari objek bisa menggunakan fungsi dari p5.js
dengan menggunakan fill().
Ingat !
• Untuk catatan nilai integer yang digunakan adalah 0
hingga 255
 fill(255) = putih
 fill(0) = hitam
 fill(255,0,0) = merah
 fill(0,255,0) = hijau
 fill(0,0,255) = biru
• fill(0,0,255,10) = biru transparan / nilai yang keempat, semakin
mendekati 0 semakin transparant dan semakin mendekati 255
semakin opaque ( Buram )
• Jika tidak menginginkan ada warna didalam objek ??? Gunakan fungsi
noFill()
Praktek 3 - fill
function setup() {
createCanvas(200, 200);
}
function draw() {
background(220);
fill(255,255,0);
circle(100,100,50);
}
Praktek 4 – fill beberapa object
function setup() {
createCanvas(200, 200);
}
function draw() {
background(220);
fill(255, 255, 0);
circle(100, 100, 50);
rect(0, 0, 100, 50);
ellipse(50, 70, 30, 30);
}
Praktek 5 – No fill
function setup() {
createCanvas(200, 200);
}
function draw() {
background(220);
fill(255, 255, 0);
circle(100, 100, 50);
rect(0, 0, 100, 50);
noFill();
ellipse(50, 70, 30, 30);
}
Praktek 6 – No fill - Transparan
function setup() {
createCanvas(200, 200);
}
function draw() {
background(220);
fill(255, 255, 0, 50);
circle(100, 100, 50);
rect(0, 0, 100, 50);
noFill();
ellipse(50, 70, 30, 30);
}
Fungsi Stroke
• Memberikan Warna pada garis Object
 stroke(0) = garis berwarna hitam
 stroke(255) = garis berwarna putih
 stroke(255,0,0) = garis berwarna merah
 stroke(0,255,0) = garis berwarna hijau
 stroke(0,0,255) = garis berwarna biru
Praktek 7
function setup() {
createCanvas(200, 200);
}
function draw() {
background(220);
fill(255, 255, 0, 50);
// Garis Hijau
stroke(0, 255, 0);
circle(100, 100, 50);
// Garis Merah
stroke(255, 0, 0);
rect(0, 0, 100, 50);
noFill();
// Garis Biru
stroke(0, 0, 255);
ellipse(50, 70, 30, 30);
}
No Stroke
function setup() {
createCanvas(200, 200);
}
function draw() {
background(220);
fill(255, 255, 0, 50);
// Garis Hijau
stroke(0, 255, 0);
circle(100, 100, 50);
// Garis Merah
stroke(255, 0, 0);
rect(0, 0, 100, 50);
noFill();
// Garis Biru
stroke(0, 0, 255);
ellipse(50, 70, 30, 30);
// Tanpa Garis
noStroke();
fill(255, 255, 0);
circle(20, 180, 50);
}
Ubah Ukuran Garis Warna
• Code : Link https://pastebin.com/qPTVsBVa
Contoh Kasus Pewarnaan Beberapa Object
• Silahkan Buka Link berikut : https://pastebin.com/RntKYZH1

More Related Content

Featured

Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 

Featured (20)

Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 

Materi Ajar - Grafika Komputer - Mewarnai Objek

  • 1. Grafika Komputer Mewarnai Object Mohammad Faried Rahmat., S.ST., M.Tr.T Teknik Informatika Universitas Islam Balitar
  • 2. Kita akan Mempelajari • Fungsi Backgroud • Fungsi Fill • Fungsi Stroke • Contoh Kasus
  • 3. Background • Untuk memberikan warna pada background • Struktur – RGB • Background(125) = background Abu abu • Background(0) = Hitam • Background(255) = putih
  • 4. Referensi Warna • Untuk mencari referensi warna silahkan cari di google dengan kata kunci : color picker
  • 5. Link Referensi Warna • https://www.niagahoster.co.id/blog/daftar-kode-warna-pada-html/ • https://qwords.com/blog/kode-warna-html-lengkap/
  • 6. Praktek 1 - Background function setup() { createCanvas(200, 200); } function draw() { background(0); }
  • 7. Praktek 2 - Background RGB function setup() { createCanvas(200, 200); } function draw() { background(252, 61, 224); }
  • 8. Fungsi Fill • Untuk mewarnai isi dari objek bisa menggunakan fungsi dari p5.js dengan menggunakan fill().
  • 9. Ingat ! • Untuk catatan nilai integer yang digunakan adalah 0 hingga 255  fill(255) = putih  fill(0) = hitam  fill(255,0,0) = merah  fill(0,255,0) = hijau  fill(0,0,255) = biru
  • 10. • fill(0,0,255,10) = biru transparan / nilai yang keempat, semakin mendekati 0 semakin transparant dan semakin mendekati 255 semakin opaque ( Buram ) • Jika tidak menginginkan ada warna didalam objek ??? Gunakan fungsi noFill()
  • 11. Praktek 3 - fill function setup() { createCanvas(200, 200); } function draw() { background(220); fill(255,255,0); circle(100,100,50); }
  • 12. Praktek 4 – fill beberapa object function setup() { createCanvas(200, 200); } function draw() { background(220); fill(255, 255, 0); circle(100, 100, 50); rect(0, 0, 100, 50); ellipse(50, 70, 30, 30); }
  • 13. Praktek 5 – No fill function setup() { createCanvas(200, 200); } function draw() { background(220); fill(255, 255, 0); circle(100, 100, 50); rect(0, 0, 100, 50); noFill(); ellipse(50, 70, 30, 30); }
  • 14. Praktek 6 – No fill - Transparan function setup() { createCanvas(200, 200); } function draw() { background(220); fill(255, 255, 0, 50); circle(100, 100, 50); rect(0, 0, 100, 50); noFill(); ellipse(50, 70, 30, 30); }
  • 15. Fungsi Stroke • Memberikan Warna pada garis Object  stroke(0) = garis berwarna hitam  stroke(255) = garis berwarna putih  stroke(255,0,0) = garis berwarna merah  stroke(0,255,0) = garis berwarna hijau  stroke(0,0,255) = garis berwarna biru
  • 16. Praktek 7 function setup() { createCanvas(200, 200); } function draw() { background(220); fill(255, 255, 0, 50); // Garis Hijau stroke(0, 255, 0); circle(100, 100, 50); // Garis Merah stroke(255, 0, 0); rect(0, 0, 100, 50); noFill(); // Garis Biru stroke(0, 0, 255); ellipse(50, 70, 30, 30); }
  • 17. No Stroke function setup() { createCanvas(200, 200); } function draw() { background(220); fill(255, 255, 0, 50); // Garis Hijau stroke(0, 255, 0); circle(100, 100, 50); // Garis Merah stroke(255, 0, 0); rect(0, 0, 100, 50); noFill(); // Garis Biru stroke(0, 0, 255); ellipse(50, 70, 30, 30); // Tanpa Garis noStroke(); fill(255, 255, 0); circle(20, 180, 50); }
  • 18. Ubah Ukuran Garis Warna • Code : Link https://pastebin.com/qPTVsBVa
  • 19. Contoh Kasus Pewarnaan Beberapa Object • Silahkan Buka Link berikut : https://pastebin.com/RntKYZH1