Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Using RGBA Colour The Bagpuss Way
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Drew McLellan
September 27, 2011
Technology
1
100
Using RGBA Colour The Bagpuss Way
From Oxford Geek Night.
Drew McLellan
September 27, 2011
Tweet
Share
More Decks by Drew McLellan
See All by Drew McLellan
HTML5 APIs PHP Yorkshire 2017
drewm
1
190
HTML5 APIs Confoo Montreal
drewm
1
260
PHP Payments with Omnipay
drewm
0
120
HTML5 APIs Confoo Vancouver
drewm
0
290
Learn to Love Regular Expressions
drewm
0
160
Ecommerce Projects with Moltin
drewm
0
690
Writing Portable PHP
drewm
0
130
Getting to Grips with Regular Expressions
drewm
1
270
Back to Front Performance - Oct 2013
drewm
0
130
Other Decks in Technology
See All in Technology
AI時代、1年目エンジニアの悩み
jin4
1
130
Claude Codeベストプラクティスまとめ
minorun365
55
31k
書籍執筆での生成AIの活用
sat
PRO
1
240
M&A 後の統合をどう進めるか ─ ナレッジワーク × Poetics が実践した組織とシステムの融合
kworkdev
PRO
1
130
Amazon Bedrock AgentCore 認証・認可入門
hironobuiga
2
460
15 years with Rails and DDD (AI Edition)
andrzejkrzywda
0
110
GCASアップデート(202510-202601)
techniczna
0
210
学生・新卒・ジュニアから目指すSRE
hiroyaonoe
1
260
【インシデント入門】サイバー攻撃を受けた現場って何してるの?
shumei_ito
0
1.3k
人はいかにして 確率的な挙動を 受け入れていくのか
vaaaaanquish
5
3.2k
AIと新時代を切り拓く。これからのSREとメルカリIBISの挑戦
0gm
0
260
Contract One Engineering Unit 紹介資料
sansan33
PRO
0
13k
Featured
See All Featured
Practical Orchestrator
shlominoach
191
11k
Information Architects: The Missing Link in Design Systems
soysaucechin
0
750
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
55
49k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.2k
Rails Girls Zürich Keynote
gr2m
96
14k
How to make the Groovebox
asonas
2
1.9k
Fashionably flexible responsive web design (full day workshop)
malarkey
408
66k
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
280
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
0
1.8k
Building a Scalable Design System with Sketch
lauravandoore
463
34k
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
0
3.4k
So, you think you're a good person
axbom
PRO
2
1.9k
Transcript
Using RGBA Colour The Bagpuss Way Oxford Geek Night 10
- 21 January 2009 Drew McLellan, edgeofmyseat.com
There are lots of different ways to specify colours in
CSS
fuchsia #FF00FF #F0F rgb(255, 0, 255) rgb(100%, 0, 100%)
However you write it, they’re identical colours. (it’s all the
same biscuit)
They all have one other important aspect in common.
These all specify solid colours.
CSS3 introduces rgba()
Red Green Blue Alpha (opacity)
rgba(255, 255, 255, 0.5)
rgba(255, 255, 255, 0.5)
But that’s what CSS3 opacity does isn’t it?
filter:alpha(opacity=50); -moz-opacity: 0.5; opacity: 0.5;
Opacity affects the entire object Hello world Hello world
RGBA is about the opacity of a colour Hello world
Hello world Hello world
Pink stripes 100% opacity
Entire Bagpuss 50% opacity
Pink stripes 50% opacity, as nature intended
Closer to a tiled, flat colour semi-transparent PNG, without the
image.
... but also works for text, borders, foregrounds, backgrounds, playgrounds.
(maybe not playgrounds)
How?
rgba(255, 255, 255, 0.5)
Browser support is ok, but not great.
Firefox 3 Safari 3 Opera 10
So how can we use this today without ending up
with a nasty old mess in rubbish old browsers that don’t support all this lovely RGBA stuff?
None
Fall back to solid colour background: rgb(187, 192, 187); background:
rgba(120, 130, 120, 0.5);
Fall back to alpha PNG background: transparent url(green50.png); background: rgba(120,
130, 120, 0.5) none;
Tell me more! http://allinthehead.com/code/rgba/ http://dorward.me.uk/www/css/alpha-colour/
allinthehead.com/presentations Thank you. twitter.com/drewm