ct.el icon indicating copy to clipboard operation
ct.el copied to clipboard

ideas

Open neeasade opened this issue 4 years ago • 10 comments

  • an explicit rgb to sRGB conversion function (or gamma correction function)
  • CMYK? Peter's color notes have what he describes as a /very rough/ set of RGB <--> CMYK conversion functions
    • note: CMYK space is smaller than RGB, so would need to be sure to clamp going out
  • munsell color system
  • color mixing by colorspace properties -- you could mix with a percentage value with all or one color property towards another (or average in the middle/mix completely, rather than approach)
  • ~support RGB colorspace (we just kinda leave everyone to their own devices there rn)~

neeasade avatar Jan 13 '21 11:01 neeasade

~a function that would tell me the resulting color of a top layer color with opacity over a bottom layer color~

neeasade avatar Jan 14 '21 22:01 neeasade

  • color temperature functions
  • color correction functions (I mention gamma correction above, but color correction in general is just a whole nother rabbit hole)

neeasade avatar Jan 19 '21 14:01 neeasade

peep chroma.js, and this article

neeasade avatar Jan 20 '21 22:01 neeasade

OKlab https://bottosson.github.io/posts/oklab/ https://raphlinus.github.io/color/2021/01/18/oklab-critique.html

neeasade avatar Jan 21 '21 18:01 neeasade

~a version of ct-iterate that "amplifies" a unary transform function when the result is the same (EG, upping the darken color by value until something happens, rather than just assuming the passed transform is enough)~

neeasade avatar Feb 06 '21 14:02 neeasade

better compensation when tweaking individual properties beyond compatible ranges -- see for example the sliders here https://css.land/lch/ -- you have to raise brightness in order to be able to raise chroma

neeasade avatar Feb 07 '21 02:02 neeasade

  • a function that takes in a color and list of colors, returning the color from the list that is closest

^ WONTFIX, currently possible:

(let* ((colors '("#000000" "#888888" "#ffffff"))
        (candidate "#777777"))
  (first
    (seq-sort-by
      (-partial 'ct-distance candidate)
      '< colors)))  ; yields "#888888"

neeasade avatar Jun 17 '22 19:06 neeasade

Would love a function to find the closest color at bit-depth d. For example, I often have to find the closest 8-bit terminal color to a 24-bit source color when defining an Emacs color theme.

tadfisher avatar Mar 15 '23 19:03 tadfisher

@tadfisher Thanks for the idea! -- in the meantime if you have a known list of colors (eg a list of "8 bit" colors) you can use something like the example I just added here: https://github.com/neeasade/ct.el/issues/5#issuecomment-1159187011

neeasade avatar Mar 15 '23 21:03 neeasade

@tadfisher Thanks for the idea! -- in the meantime if you have a known list of colors (eg a list of "8 bit" colors) you can use something like the example I just added here: https://github.com/neeasade/ct.el/issues/5#issuecomment-1159187011

Actually that makes sense; I didn't realize that "256 color" terminals use particular color values instead of a uniform 8-bit distribution. Thanks!

tadfisher avatar Mar 15 '23 21:03 tadfisher