package camlimages
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=7e46c7774f2f12b42feefdec8b0f43add2523d24432e1b333160d63330ab4dd2
md5=521b7dbafd64afcca31dd3a908a5db31
doc/camlimages.core/Color/index.html
Module Color
Definition of colormaps, i.e. mappings from real RGB colors to integers. The integer corresponding to a color c is an index i into a vector of colors whose ith element is c.
An exception raised when too many number of colors are used for a given color model.
Colormap manipulation functions
val size : 'a map -> intReturns the size of a colormap.
val find_exact : 'a map -> 'a -> intFinds a color in the colormap and returns its color index. Raises exception Not_found if the color is not in the colormap.
val add_color : 'a map -> 'a -> intAdd a new color into the given colormap and return its index. If the color is already in the colormap, it is not added again, and the corresponding color index is returned.
val add_colors : 'a map -> 'a list -> int listAdd the list of new colors into the given colormap and return their indices. If a color is already in the colormap, it is not added again, and the corresponding color index is returned.
module type S = sig ... endR(ed), G(reen), B(lue) representation of colors.
RGB with alpha (transparent) information
module Rgba : sig ... endColormap for RGBA
Cyan Magenta Yellow blacK color model
Rgb specialized functions (for backward compatibility)
val brightness : rgb -> intColor name parser
val color_parse : string -> rgbColor name parser function.
It queries the name in the color name database given by the file Camlimages.path_rgb_txt. It also understands the following color format:
"#rrggbb" where r,g and b are 0-9a-fA-F "#rrrrggggbbbb" where r,g and b are 0-9a-fA-F
It may raise Failure if not found.
val colormap_parse : string array -> rgb array * intSame as color_parse but work for multiple names.
If a color of the result has a minus value for its R component, it is considered transparent and replaced by r=0 g=255 b=0. The function returns the last transparent color index.