package ocolor
Install
dune-project
Dependency
Authors
Maintainers
Sources
md5=094b701f30af41b89f554e978cb0762c
sha512=b558fb735d28c262b0cf047835df2bc59e89daf44fbaf55b3d73293457713cb2a45805965f4bd6aafac1e7bc6325b3e70ec59d3e4a096b25e99072fee68ac8ce
doc/ocolor/Ocolor_color_space/index.html
Module Ocolor_color_space
Color space functions
Downgrade
These functions find the closest color from a given 24-bits color in some subspace. They use the euclidean distance in CIELAB color space with the CIE standard illuminant D65. It should be good enough! There is currently no way to change the standard illuminant or the metric.
val closest_color4 : Ocolor_types.rgb -> Ocolor_types.color4Choose the closest color in the current palette, according to the current Ocolor_config.palette. Used only when trying to print a 24-bits color in a terminal with only 4-bits capability. Should probably never happen since most terminals have truecolors support.
val closest_color8 : Ocolor_types.rgb -> Ocolor_types.color8Choose the closest color in the current palette, according to the current Ocolor_config.palette. Used only when trying to print a 24-bits color in a terminal with only 8-bits capability. Should probably never happen since most terminals have truecolors support.
Upgrade
val rgb_of_color4 : Ocolor_types.color4 -> Ocolor_types.rgbReturn the rgb color associated to the 4-bits color in argument, according to the current Ocolor_config.palette. Only used to upgrade a 4-bits color to a 24-bits color. Never used in normal circumstances, but avaiable for the developper. Indeed, the result might look different than directly printing the 4-bits color if the current palette does not match the terminal settings.