PCE version 4C man_modulenamespaceid_tablemodified current_idOIxN class/colourN referenceC hash_tablerefersizeOIxNbothIsNM.colour.G.reduceCman_method_card identifiermodule last_modifiednamesummary descriptionsee_alsoinherit diagnosticsdefaultsbugsOIxNM.colour.G.reduceRICdateOIx<ÏåúNreducenCstringOIx»Return a darker/lighter version of this colour. This method is together with <-hilite by class elevation to determine colours of the lighted and shadow sides of the elevated area. The factor determines how far the colour is translated to black (<-reduce) or white (<-hilite). Zero does not modify the colour, while 1.0 always returns black or white. The colours are associated to the original colour such that requesting the same modified colour avoids creating a new colour object and destruction of the main colour causes the derived to loose a reference. XPCE colours also support the HSV colour-model to simplify arithmetic with colours. See ->initialise, ->hue, ->value and ->saturnation.nnnnnsNM.colour.G.convertOIxNM.colour.G.convertRIOIx0µ¸:NconvertnOIxFirst performs a <-lookup in @colours (the already created colour objects). If this fails it will create a colour object from the name and RGB values from the X11 RGB database. A name with format `#' followed by 6 or 12 hexadecimal digits will be interpreted as a `RBG' triple: #c0453f is translated to a colour named `#c0453f' with <-red: 192*256, <-green: 69*256 and <-blue: 63*256. If there are 12 hexadecimal digits the values are not multiplied by 256. This conversion is compatible with the X11 colour specification.nnnnnsNM.colour.G.intensityOI xNM.colour.G.intensityRIOI x/ÀwòN intensitynOI xvReturns the corresponding grey-value of a colour. This value is computed as: 0.5 <-green + 0.32 <-red + 0.18 <-bluennnnnsNM.colour.S.initialiseOI xNM.colour.S.initialiseRIOI x:´±ÎN initialisenOIx¨Create a colour object from its <-name or specification in RGB or HSV colour-space. Named colours are especially suitable on 256-colour X11 displays as they exploit sharing colours. Using named colours also improves the readability of your source-code. In the windows version, the X11 name-table is available through the hash_table @colour_names. It is allowed to specify a colour using an RBG triple using the name-encoding #RRGGBB, where RR, GG and BB are hexadecimal representations of the Red, Green and Blue values. See also <-convert. If the name argument is @default, a colour must be specified in the RBG or HSV model. As the argument-names suggest, the default is to the RBG model using the X11 16-bit intensity notation. The following creates a red colour. new(C, colour(@default, 65535, 0, 0)) The HSV (Hue, Saturation, Value) is much easier to use for transforming colours. See <-hue for details on this model.nnnnnsN V.colour.nameCman_variable_card identifiermodule last_modifiednamesummary descriptionsee_alsoinheritdefaultsOIxN V.colour.nameRIOIx,}EšNnamenOIxÙName of the colour. Normally this is a name from the X11 colour database situated in /usr/lib/X11/rgb.txt (depending on your installation). If it is another name, the user must specify the RGB triple for the colour.nnnsNM.colour.G.valueOIxNM.colour.G.valueRIOIx:´±ÛNvaluennnCchainsizeOIxIeNM.colour.G.hueXnnnsNV.colour.greenOIxNV.colour.greenRIOIx,{b‰NgreennnnOIxIEN V.colour.blueXnsN V.colour.blueOIxN V.colour.blueRIOIx0´`qNbluenOIxÄColour component. Its value ranges from `0' (off) to `65535' (bright). Colours may also be used for grey-scale screens. Most hardware uses the <-green component of the colour for the grey-value.nnnsNM.colour.G.hiliteOIxNM.colour.G.hiliteRIOIx/·%êNhilitennnOIxIENM.colour.G.reduceXnnnsN V.colour.redOIxN V.colour.redRIOIx,{bŒNrednnnOI xIEN V.colour.blueXnsNM.colour.G.storage_referenceOI!xNM.colour.G.storage_referenceRIOI"x/Àw„Nstorage_referencenOI#xqIf the colour is of <-kind: named, return the <-name of the colour. Otherwise return `#', where , and are two-digit hexadecimal numbers describing the colour components. The return value of this method should be valid input for the <-convert method of the class. See also `object <-storage_reference', `object ->save_in_file' and `file <-object'.nnnnnsNM.colour.G.saturnationOI$xNM.colour.G.saturnationRIOI%x:´±×N saturnationnnnOI&xIeNM.colour.G.hueXnnnsNC.colourCman_class_card identifiermodule last_modifiednamesummary descriptionsee_alsoinherituser_interfacebugsOI'xNC.colourRIOI(x:´¯šNcolournOI)xA `colour' object represents a RGB (red-green-blue) colour value. Colours may be associated with graphical objects: ?- send(new(P, picture), open), send(P, display, new(B, box(100, 100))), send(B, colour, red), send(B, fill_pattern, blue). Like fonts and cursors, colour objects are reusable (that is, they can be attached to multiple graphicals). PCE will not recreate the same colour object twice. Instead, it will just return an identical existing colour object. Unless user-defined colours are used, colours are normally just specified by name and converted by PCE's type conversion mechanism. The type conversion system converts names of colours as defined by the X-window system (the Win32 version has the X colourname table builtin) to colour objects. All created colours are in the table @colours. Besides named colours, XPCE allows for specifying colours as RGB triples or HSV triples. See ->initialise for details. The demo-browser (in File/Demo programs) contains two alternative colour selectors.OI*xIeN#$class/device$M.device.S.foregroundeN#$class/graphical$V.graphical.coloureN$class/window$M.window.S.colourEN%$class/graphical$M.graphical.S.colourXnnOI+x¯Currently the possibilities with colours are limited. PCE has been developed on a monochrome display and only we had only temporary access to a colour workstation to implement colours. Notably colours in dialog windows and dialog items have to be extended. It is not possible to change colour values. Colour objects cannot be destroyed. This may caused problems on colour devices that support only a limited amount of colours.sN V.colour.kindOI,xN V.colour.kindRIOI-x,}EšNkindnOI.x¯When `named', the colour was ->initialise'd using only the name argument. The <-name must be a valid X11 colour-name. When `rgb', the colour was created using an RGB-triple.nnnsNM.colour.S._xopenOI/xNM.colour.S._xopenRIOI0x,{açN_xopennOI1xªCreate the X-counterpart for the specified display and register it in the internal X-reference table. The X-counterpart for a colour is not created before it is needed.nnnnnsNM.colour.G.hueOI2xNM.colour.G.hueRIOI3x:´´¤NhuenOI4xÛQuery the colour in the HSV colours-space. This space is defined by the following parameters: # <-hue (0..360) The Hue value refers to the basic colour. You can see it as a selection in the rainbow. # <-saturnation (0..100) The saturnation indicates how intense the colour is. At value 0, the hue is completely ignored and the colour becomes a grey-value. At 100 the colours a unnaturally bright. # <-value (0..100) The value refers to the light-intensity. At 0 the colour is always black, at 100 it is white. This value may be manipulated to reflect shading. Colours may be created in this space using ->initialise: new(C, colour(@default, 180, 50, 50, hsv)). The HSV space is useful for estimating the user's perception, creating pallettes and lighthing effects. Reasoning in colour-spaces is beyond the scope of this manual. You may wish to check out the demo tool (File/Demo browser) "HSV Colours" to get an impression on handling colours in the HSV space.nnnnnXaCnumber O I5xx