Module: Termin::ANSIColor::RGBColorMetrics::CIELab

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

Defined Under Namespace

Classes: CIELabTriple

Class Method Summary collapse

Class Method Details

.distance(rgb1, rgb2) ⇒ Object



153
154
155
156
157
# File 'lib/termin/ansicolor/rgb_color_metrics.rb', line 153

def self.distance(rgb1, rgb2)
  lab1 = CIELabTriple.from_rgb_triple(rgb1)
  lab2 = CIELabTriple.from_rgb_triple(rgb2)
  lab1.weighted_euclidean_distance_to lab2
end