ยค tryAllocColor, tryAllocColorF, et al

Color

Types

tryAllocColor :: FudgetIO f => ColormapId -> RGB -> (Maybe Color -> f b ho) -> f b ho
tryAllocColorF :: ColormapId -> RGB -> Cont (F b c) (Maybe Color)
allocColor :: FudgetIO f => ColormapId -> RGB -> Cont (f b ho) Color
allocColorF :: ColormapId -> RGB -> Cont (F b c) Color
allocColorPixel :: FudgetIO f => ColormapId -> RGB -> Cont (f b ho) Pixel
allocColorPixelF :: ColormapId -> RGB -> Cont (F b c) Pixel
tryAllocNamedColor :: FudgetIO f =>
                      ColormapId -> ColorName -> (Maybe Color -> f b ho) -> f b ho
tryAllocNamedColorF :: ColormapId -> ColorName -> Cont (F b c) (Maybe Color)
allocNamedColor :: FudgetIO f => ColormapId -> ColorName -> Cont (f b ho) Color
allocNamedColorF :: ColormapId -> ColorName -> Cont (F b c) Color
allocNamedColorPixel :: FudgetIO f => ColormapId -> ColorName -> Cont (f b ho) Pixel
allocNamedColorPixelF :: ColormapId -> ColorName -> Cont (F b c) Pixel
allocNamedColorDef :: FudgetIO f =>
                      ColormapId -> ColorName -> String -> Cont (f b ho) Color
allocNamedColorDefPixel :: FudgetIO f =>
                           ColormapId ->
                           ColorName -> String -> (Pixel -> f b ho) -> f b 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 b ho
a fudget kernel parameterized by a Maybe Color value.

See Also

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