2013年12月17日 星期二

[Color2]:Components

color(red,green,blue,transparency):取得rg、transparency值
  • red(color)
  • green(color)
  • blue(color)
  • transparency(color)

切換成HSBMode
  • colorMode(HSB,300,100,100)color(hue,saturations,brightness):切換成HSBMode
  • hue(color)saturation(color)brightness(color):取得HSB
  • background(PImage):圖片設為背景
  • PImage.widthPImage.height:取得照片的寬高
  • imageColors[y*img.height+x] = img.get(x,y):填完一row向下移
Exercises
  • Write a program to print the red,green and blue values of each pixel in an image to the console.
  • Design a composition that changes based on mouseX value. Make the color for each element of the composition also change in relation to this variable.
  • Load an image and use its colors to set the palette for a composition.

Reference

  • Casey Reas & Ben Fry : Page348

沒有留言:

張貼留言