ยค tryAllocColor, tryAllocColorF, et al

Color

Types

tryAllocColor :: FudgetIO f =>
                 ColormapId -> RGB -> (Maybe Color -> f hi ho) -> f hi ho
tryAllocColorF :: ColormapId -> RGB -> Cont (F b c) (Maybe Color)
allocColor :: FudgetIO f => ColormapId -> RGB -> Cont (f hi ho) Color
allocColorF :: ColormapId -> RGB -> Cont (F b c) Color
allocColorPixel :: FudgetIO f => ColormapId -> RGB -> Cont (f hi ho) Pixel
allocColorPixelF :: ColormapId -> RGB -> Cont (F b c) Pixel
tryAllocNamedColor :: FudgetIO f =>
                      ColormapId -> ColorName -> (Maybe Color -> f hi ho) -> f hi ho
tryAllocNamedColorF :: ColormapId -> ColorName -> Cont (F b c) (Maybe Color)
allocNamedColor :: FudgetIO f => ColormapId -> ColorName -> Cont (f hi ho) Color
allocNamedColorF :: ColormapId -> ColorName -> Cont (F b c) Color
allocNamedColorPixel :: FudgetIO f => ColormapId -> ColorName -> Cont (f hi ho) Pixel
allocNamedColorPixelF :: ColormapId -> ColorName -> Cont (F b c) Pixel
allocNamedColorDef :: FudgetIO f =>
                      ColormapId -> ColorName -> String -> Cont (f hi ho) Color
allocNamedColorDefPixel :: FudgetIO f =>
                           ColormapId ->
                           ColorName -> String -> (Pixel -> f hi ho) -> f hi ho

Synopsis

tryAllocColor colormap rgb colkernel
data RGB = RGB Int Int Int
data Color = Color {colorPixel :: Pixel, colorRGB :: RGB}
data Pixel = Pixel Word

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 -> f hi ho
a fudget kernel parameterized by a Maybe Color value.

See Also

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