Skip to content

Latest commit

 

History

History
122 lines (120 loc) · 5.02 KB

planning.org

File metadata and controls

122 lines (120 loc) · 5.02 KB

Scarlet: Colors and Color Spaces For Rust (think of good tagline)

Color Types

  • RGB
  • RGBA
  • sRGB / different gammas and primaries
    • implement by making them attributes of platform-independent colors so that From will work correctly
  • HSV
  • HSL
  • LAB
  • CIELUV
  • XYZ

Color Input Formats

  • HTML names
  • HTML hex
    • TODO: implement shortened hex (e.g., #03b)
  • HTML funcs (e.g., rgba(0, 0, 1, 0))
  • Full initalizer functions (e.g., HSLColor(232, 94, 94))

Color Functions

  • Average n colors in a specified space with weights (e.g., avg(red, green, blue) in RGB => grey, in HSV => green)
  • Mix (i.e., additively or subtractively superimpose) colors in a given space (e.g., red + blue = fuschia in RGB)
  • Get gradient scales (ranges of colors interpolated in a color space, so in HSV you’d have red -> yellow -> green and in RGB you’d have blue -> violet -> purple -> fuchsia)
    • Logarithmic/other kinds as well?
    • Padding?
  • Common colormaps implemented from scratch (cubehelix, jet (shudder), MATLAB ones, rainbow, grayscale)
    • Arbitrary gradients as colormaps
  • Color distances in each color space
  • Color temperature
  • Convert colors in between color spaces
  • Clamp colors within a gamut
  • Get luminance/lightness/luma values (should probably be separate than color conversion to space with luminance)
    • Special convenience function for getting grayscale version of a color?
  • Format to a string (valid HTML format)
  • Individually set coordinates and change color (e.g., c.r = 142)
  • Print to terminal?

Things Between Now and v1.0

Color Types

  • [X] Adobe RGB
  • [X] ProPhoto RGB
  • [-] sHSL
    • [X] Implement basic functionality
    • [ ] Add string conversion functions
    • [ ] Add custom equality to deal with saturation and hue messiness
  • [ ] sHSV
  • [X] CIELUV
    • [X] Deal with chromatic adaptation
  • [ ] CMYK
  • [X] CIELCH
  • [X] CIEHCL

Color Input Formats

  • [X] HTML names
  • [X] HTML hex
  • [X] HTML shortened hex
  • [ ] HTML initalizer functions
  • [X] Illuminant white points
  • [ ] Iterables of various kinds?
  • [ ] Use traits (FromStr)
  • [ ] Clever enum for color names?

Color Output Formats

  • [ ] Coord if it makes sense
  • [ ] (a, b, c) if that makes sense
  • [X] hex code
  • [ ] html rgb( function call
  • [ ] html hsl( function call
  • [ ] Integral formats where that makes sense
    • [ ] sRGB
    • [ ] CIELAB

Color Functions

  • [X] Implement floating-point exact values for RGB
  • [ ] Everything implements standard traits
  • [X] Some sort of safe modification/getter/setter?
  • [ ] Use correct floating-point methods everywhere to tamp down on error
  • [ ] Use borrowing correctly
    • [ ] Implement correct borrowing for Coord and co.
  • [ ] Average n colors of the same type
    • [ ] Test this
  • [ ] Superimposition of n colors of the same type
  • [-] Gradient scales (basically n colors in a sequence of equal color distance, the smallest possible, between two colors in the same space)
    • [X] Linear
    • [ ] Logarthmic
    • [ ] Cube root
    • [ ] Square root
    • [ ] Pad scale on both ends by some fraction of total distance
    • [ ] Test
  • [X] Gradient functions (basically as above, but instead of a scale it returns a new function f(x) -> color where 0 <= x <= 1)
  • [ ] Common colormaps (MATLAB, jet (shudder), rainbow (shudder))
  • [X] Distance between 2 colors of the same type
  • [X] Perceptual distance between any two colors
  • [ ] Allow use of IntoIterator instead of Vec
  • [X] Grayscale version of color
  • [X] Convenience functions for:
    • [X] Hue angle
    • [X] Lightness
    • [X] Chroma
    • [X] Saturation
  • [ ] Clamp color to the closest one representable by a given gamut
  • [X] Get closest visible color
  • [X] Determine whether color is imaginary

Documentation/Testing

  • [ ] Clean up and reorganize files
  • [ ] Use the right modules in main namespace
  • [ ] Every single public piece of code is documented
  • [ ] Every single public piece of documentation has an example
  • [ ] Tests are comprehensive at the very least at the function level: every method should be called in a test
  • [ ] “Guide” wrtten to alleviate problem of no high-level documentation
  • [ ] Tests don’t have any fudging in them (check!)
  • [ ] All tests use approx_equal when comparing colors to ensure loss of precision is within acceptable bounds
  • [ ] Make public commitment to a given level of precision and use integration testing to verify it and target areas of precision loss
  • [ ] Judicious links in documentation (research more)
  • [ ] Add comprehensive guide with examples on gamuts, integral spaces, and anything that can mess up conversions
    • [ ] Add section on actually fixing issues
  • [ ] Add ideology doc
  • [ ] Add tests that use external programs and test cases instead of just preserving identity
  • [ ] Add something that clearly explains the trickiness of HSV systems: e.g., setting black’s hue to 270 and then getting its hue won’t return 270

Misc

  • [ ] Put extern crates in root
  • [ ] Remove unneeded dependencies
  • [ ] Figure out what needs to be public or not