Module: Termin::ANSIColor::RGBColorMetrics::CIEXYZ

Defined in:
lib/termin/ansicolor/rgb_color_metrics.rb

Defined Under Namespace

Classes: CIEXYZTriple

Class Method Summary collapse

Class Method Details

.distance(rgb1, rgb2) ⇒ Object



115
116
117
118
119
# File 'lib/termin/ansicolor/rgb_color_metrics.rb', line 115

def self.distance(rgb1, rgb2)
  xyz1 = CIEXYZTriple.from_rgb_triple(rgb1)
  xyz2 = CIEXYZTriple.from_rgb_triple(rgb2)
  xyz1.weighted_euclidean_distance_to xyz2
end