{"size": 1651, "ext": "scrbl", "max_stars_repo_path": "scribblings/image-colors.scrbl", "max_stars_repo_name": "thoughtstem/image-colors", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "scribblings/image-colors.scrbl", "max_issues_repo_name": "thoughtstem/image-colors", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "scribblings/image-colors.scrbl", "max_forks_repo_name": "thoughtstem/image-colors", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 23.9275362319, "max_line_length": 455, "alphanum_fraction": 0.6801938219}
#lang scribble/manual
@require[@for-label[image-coloring
                    2htdp/image
                    racket/base]]

@title{image-coloring}
@author{thoughtstem}

@(require "../main.rkt" 2htdp/image)

@(define chicken-sheet (bitmap "./img/chicken-sheet.png"))

@defmodule[image-coloring]

This is for doing basic color shifting transformations on @racket[image?] values.  It does this by converting them into bitmaps and operating on the pixels.  What is returned is a bitmap.  So keep that in mind if you are intending to do operations like @racket[scale] downstream of, say, a @racket[change-hue].  If you scale up after the hue shift, you'll see a blury image.  If you scale up before, the color shift will have to operate on more pixels.   

@defproc[(change-hue [amount from-0-to-360?] [img image?]) image?]{
  Shifts the image's hue by the given @racket[amount].

  @codeblock{
    #lang racket
    (require image-coloring)

    (change-hue 50 (circle 40 'solid 'red))
  }

  Gives us:

  @(change-hue 50 (circle 40 'solid 'red))

  Or:
  
  @codeblock{
    #lang racket
    (require image-coloring)

    (change-hue 50 chicken-sheet)
  }

  Gives us:

  @(change-hue 50 chicken-sheet)

  Whereas the original was:
  
  @chicken-sheet
}

@defproc[(tint-image [color color?] [img image?]) image?]{
  Overlays the given color onto non-transparent pixels of @racket[img].

  @codeblock{
    #lang racket
    (require image-coloring)

    (tint-image "red" chicken-sheet)
  }

  Gives us:

  @(tint-image "red" chicken-sheet)

  Whereas the original was:
  
  @chicken-sheet
}

TODO: Test and document the other functions in @racket[main.rkt]
