¤ tryAllocColor, tryAllocColorF, et al

Types

tryAllocColor :: (FudgetIO c) => ColormapId -> RGB -> (Maybe Color -> c a b) -> c a b
tryAllocColorF :: ColormapId -> RGB -> Cont (F a b) (Maybe Color)
allocColor :: (FudgetIO c) => ColormapId -> RGB -> Cont (c a b) Color
allocColorF :: ColormapId -> RGB -> Cont (F a b) Color
allocColorPixel :: (FudgetIO c) => ColormapId -> RGB -> Cont (c a b) Pixel
allocColorPixelF :: ColormapId -> RGB -> Cont (F a b) Pixel
tryAllocNamedColor :: (FudgetIO c) => ColormapId -> ColorName -> (Maybe Color -> c a b) -> c a b
tryAllocNamedColorF :: ColormapId -> ColorName -> Cont (F a b) (Maybe Color)
allocNamedColor :: (FudgetIO c) => ColormapId -> ColorName -> Cont (c a b) Color
allocNamedColorF :: ColormapId -> ColorName -> Cont (F a b) Color
allocNamedColorPixel :: (FudgetIO c) => ColormapId -> ColorName -> Cont (c a b) Pixel
allocNamedColorPixelF :: ColormapId -> ColorName -> Cont (F a b) Pixel
allocNamedColorDef :: (FudgetIO c) => ColormapId -> ColorName -> [Char] -> Cont (c a b) Color
allocNamedColorDefPixel :: (FudgetIO c) => ColormapId -> ColorName -> [Char] -> (Pixel -> c a b) -> c a b

Synopsis

tryAllocColor colormap rgb colkernel

data RGB = RGB Int Int Int
data Color = Color Pixel RGB
data Pixel = Pixel Int

Description

These functions are used to look up a color with a given name or RGB value and allocate an entry for it in a colormap.

The functions whose names do not begin with try abort the program with an error message, if the allocation fails.

allocNamedColorDef and allocNamedColorDefPixel first tries to allocate one color. If that fails it outputs a warning message on the standard error channel and tries a fallback color.

Arguments

colormap :: ColormapId
the colormap in which an entry is allocated. defaultColormap is the only supported colormap in the current implementation.
rgb :: RGB
the RGB values of the color
colkernel :: Maybe Color -> c a b
a fudget kernel parameterized by a Maybe Color value.

See Also

xrequestK, tryM, queryColor, XAllocColor in the Xlib Reference Manual .