Module: Termin::ANSIColor::RGBColorMetrics::YUV

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

Defined Under Namespace

Classes: YUVTriple

Class Method Summary collapse

Class Method Details

.distance(rgb1, rgb2) ⇒ Object



88
89
90
91
92
# File 'lib/termin/ansicolor/rgb_color_metrics.rb', line 88

def self.distance(rgb1, rgb2)
  yuv1 = YUVTriple.from_rgb_triple(rgb1)
  yuv2 = YUVTriple.from_rgb_triple(rgb2)
  yuv1.weighted_euclidean_distance_to yuv2
end