Skip to content

Instantly share code, notes, and snippets.

@hecomi
Created March 6, 2013 17:30
Show Gist options
  • Save hecomi/5101212 to your computer and use it in GitHub Desktop.
Save hecomi/5101212 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'rmagick'
width = 100
height= 100
url = 'https://si0.twimg.com/profile_images/3345985110/ce68eba70a439a797006d8451dbe51a7_bigger.gif'
image = Magick::Image.read(url).first
image.resize!(1, 1)
color = image.get_pixels(0, 0, 1, 1)[0];
red = color.red / 256
green = color.green / 256
blue = color.blue / 256
cmd = 'blink1-tool --rgb %d,%d,%d' % [red, green, blue]
system cmd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment