チーズナンの裏

都内勤務社畜Webエンジニアの自分用メモ。基本的にはフロント中心。

色の補完 - d3-interpolate

D3.js

d3js.org

  • データビジュアリゼーションライブラリ
  • チャートや図などを簡単にかけるライブラリ

d3-interpolate

github.com

  • 2つの値の間を補完するライブラリ
  • 数値の補完から色の補完までおこなう
  • ソースを見る感じ、色差は厳密に考慮されていない?
  • 改善の余地ありか

d3-scale

wizardace.com

  • こちらも同様に補完してくれる
  • 色差計算の必要あり?

Gitの謎エラー - Xcodeのせいかも編

発生したエラー

  • いつもどおり作業しようとgitコマンドを打ち込むと下記のエラー。
xcrun: error: active developer path ("/Applications/Xcode.app/Contents/Developer") does not exist

原因?

  • Macの容量の問題で削除したXcodeが原因?
  • ぶっちゃけよくわからない

対策

  • 下記サイトの方のを参考にさせていただくことに

tiro105.hateblo.jp

  • とりあえず
brew doctor

結果(現れたWarningたち抜粋)

Warning: You have the following deprecated, official taps tapped:
  Homebrew/homebrew-binary
Untap them with `brew untap`.

Warning: "config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and which additional flags to use when
compiling and linking.

Warning: No developer tools installed.
Install the Command Line Tools:
  xcode-select --install


Warning: Unbrewed header files were found in /usr/local/include.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Warning: You have unlinked kegs in your Cellar.
Leaving kegs unlinked can lead to build-trouble and cause brews that depend on
those kegs to fail to run properly once built. Run `brew link` on these:
  ghostscript
  heroku
  python
xcrun: error: active developer path ("/Applications/Xcode.app/Contents/Developer") does not exist
Use `sudo xcode-select --switch path/to/Xcode.app` to specify the Xcode that you wish to use for command line developer tools, or use `xcode-select --install` to install the standalone command line developer tools.
See `man xcode-select` for more details.

Warning: Homebrew's sbin was not found in your PATH but you have installed
formulae that put executables in /usr/local/sbin.
Consider setting the PATH for example like so:
  echo 'export PATH="/usr/local/sbin:$PATH"' >> ~/.bash_profile

Warning: Broken symlinks were found. Remove them with `brew cleanup`:

なるほどわからん
とりあえず言われたとおりにコマンドを打ちこんでみる

xcode-select --install

するとコマンドラインデベロッパーツールなるやつをインスコしろとの指示が...

(とりあえずここまで)

参考にしたサイト様

qiita.com

qiita.com

色差について

色差・色空間について調べたので自分なりにまとめてみた.
全然わからん...

色差

  • 二色間の違いを定義したもの.
  • 色差が大きいほど区別しやすい.小さいほど区別しにくい.
  • ユークリッド距離で定義される.
  • 従来はRGBからなる線形3次元空間で構成される色空間で計算される.
  •  distance = \sqrt{(R _ 2-R _ 1)^ 2+(G _ 2-G _ 1)^ 2+(B _ 2-B _ 1)^ 2}
  • 様々な近似や色相の形状を考えたりされたが,単純なユークリッド距離に近い傾向を表すヒトの視覚特性を考慮していない.

LAB Delta E

  • 色差を\Delta E^*と定義
  • 様々な研究によって,色同士がギリギリ弁別できる距離である\Delta Eの値がたくさん提案されている.
  • 値も1.0→2.3に移ろっている
  • しかしもととなっているCIE LAB色空間の近く的非均一性が問題で,CIE 1994, CIE 2000の計算式が定義された.

色差式

  • 異なる二色間の色差をユークリッド距離?で導き出すための式.
  • Color difference Delta E
  • CIELAB色空間
  • CIE1976
    • 初めて定義された色差式
    • CIELAB座標におけるユークリッド距離として計算
    • CIELAB色空間は彩度の大きさによって近く的に非均一であると明らかになり、1994, 2000に置き換えられている。
  • CIE 2000が今の所一番新しいらしい