SVG / その2 / 透明度 fill-opacity 設定

執筆者:

カテゴリ:

,

テスト環境

  • パソコン Windows11
  • アプリ メモ帳などのテキストエディタ
  • ブラウザ Firefox

PNG

SVG 完成イメージ。PNG 画像。

SVG の完成イメージです。当サイト環境では、SVG ファイルをアップロード出来ないので、PNG 画像を掲載しています。

fill-opacity

fill(塗り)opacity(不透明度)のようです。インターネットで翻訳してみました。

SVG ソースコード

test-2.svg

<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="400" height="400">
<!--四角 透明度 0.6-->
<rect width="100%" height="100%" fill="#601886" fill-opacity="0.6" />
<!--四角 透明度 0.8-->
<rect width="300" height="300" x="50" y="50" fill="#601886" fill-opacity="0.8" />
<!--四角 透明度 1-->
<rect width="100" height="100" x="50" y="50" fill="#601886" fill-opacity="1" />
<rect width="100" height="100" x="250" y="50" fill="#601886" fill-opacity="1" />
<rect width="100" height="100" x="250" y="250" fill="#601886" fill-opacity="1" />
<rect width="100" height="100" x="50" y="250" fill="#601886" fill-opacity="1" />
<rect width="100" height="100" x="150" y="150" fill="#601886" fill-opacity="1" />
<!--テキスト-->
<text x="200" y="225" fill="white" font-size="100" text-anchor="middle" fill-opacity="0.8">400px</text>
</svg>

あとがき

ページから色を採取。

「#601886」の色は、当ブログのサイトアイコンから、Firefox の「ウェブ開発ツール」→「ページから色を採取 Ctrl + Shift + Y」で取得しました。

上の画面の状態で、マウスの左クリックをすると、クリップボードに色がコビー出来ます。

ページから色を採取。起動ボタン。

「ページから色を採取」ボタン。

1,147文字

以上閲覧ありがとうございました。

インターネット広告

「ファイヤーフォックス」という映画があるようです。

Amazon.co.jp アソシエイト

https://amzn.to/4xFwS43

OANDA証券

1ドルから始められるFX!最低取引1通貨単位!

Insta360°

Insta360 Pro 視聴者を魅了する〜8K VR