
Originally Posted by
AndyRage
The short answer is 'not yet', but will be added in a future update.
The long answer is: Select the sample tool, do a stroke event on the point, access the colour information through the scripting calls in 'Paint colour calls' section of the scripting guide. (ColourH(), ColourL(), ColourS(), ColourR(), ColourG(), ColourB(), ColourMetal(). Note the evil use of British English spelling of Colour. )
Hm, doing a stroke event doesn't seem to work. Is there something wrong with my script?
Code:
<Header>
Script Feature Flags: 0x000000015
</Header>
<Events>
real rHue = 0
real rRed = 0
real rGrn = 0
real rBlu = 0
//Fill the layer with 50% Gray (note the proper American English spelling of 'grey')
SetColourRGB(0.5,0.5,0.5)
Wait: 0 EvType: Command CommandID: CID_ToolSelect ParamType: ToolID Value: { 4921 (Fill Tool ) }
Wait: 0 EvType: Command CommandID: SetToolProperty ParamType: ToolProp Value: { 0x0B2D05E65 (Opacity), 1.0 }
Wait: 0 EvType: Command CommandID: SetToolProperty ParamType: ToolProp Value: { 0x0B2D05E57 (Spread), 0.0 }
Wait: 0 EvType: Command CommandID: SetToolProperty ParamType: ToolProp Value: { 0x0B2D05E47 (Blend Mode), 1 }
Wait: 0 EvType: Command CommandID: SetToolProperty ParamType: ToolProp Value: { 0x0B2D05E58 (Antialias Edge ), 0 }
Wait: 0 EvType: Command CommandID: SetToolProperty ParamType: ToolProp Value: { 0x0B2D05E44 (Single Layer), 1 }
<StrokeEvent>
Loc: (20, 20) Pr: 1 Ti: 1 Ro: 0 Rv: NO Iv: NO
</StrokeEvent>
MessageBox("switching foreground color to red")
//Set foreground color to Red
SetColourRGB(1,0,0)
//Take a color sample
Wait: 0.000s EvType: Command CommandID: CID_ToolSelect ParamType: ToolID Value: { 4909 (Color Sampler) }
Wait: 0.000s EvType: Command CommandID: SetToolProperty ParamType: ToolProp Value: { 0x0B2D05E44 (Single Layer), 1 }
Wait: 0.000s EvType: Command CommandID: SetToolProperty ParamType: ToolProp Value: { 0x0B2D05E45 (With Lighting), 0 }
<StrokeEvent>
Loc: (20, 20) Pr: 1 Ti: 1 Ro: 0 Rv: NO Iv: NO
</StrokeEvent>
//Read and give feedback on foreground color... it's red!
rHue = ColourH(); rRed = ColourR(); rGrn = ColourG(); rBlu = ColourB()
MessageBox("Foreground color after using Color Sampler: Hue=%%rHue, R=%%rRed, G=%%rGrn, B=%%rBlu")