Graphics Mode Saturation

Post Reply
IRIGIMA
Posts: 21
Joined: Wed May 03, 2017 10:30 pm
My devices: iOS iPhone 6
Flag: Great Britain
Contact:

Graphics Mode Saturation

Post by IRIGIMA »

Urgent help required.

Does anyone know how the "Graphics Mode Saturation" works and calculates the results from source / background RGB / HSV values.

Looked everywhere and cannot find online.
Explanation in manual not enough to simulate this filter.

User avatar
Mr. Kibernetik
Site Admin
Posts: 4786
Joined: Mon Nov 19, 2012 10:16 pm
My devices: iPhone, iPad, MacBook
Location: Russia
Flag: Russia

Re: Graphics Mode Saturation

Post by Mr. Kibernetik »

Maybe these blend mode examples can be of some help for you:
https://developer.apple.com/library/arc ... 2-CJBIJEFG

IRIGIMA
Posts: 21
Joined: Wed May 03, 2017 10:30 pm
My devices: iOS iPhone 6
Flag: Great Britain
Contact:

Re: Graphics Mode Saturation

Post by IRIGIMA »

Using the saturation filter under a certain condition does not result in what it should.

Can you explain the following:
With a grey background, overlay a rectangle with any colour using the color mode saturation.
The result should be grey - but it is blue.

I have done a lot of research and experimenting, but cannot find a solution.

Here is the code:

setupgraphics:
GRAPHICS
SET TOOLBAR on
GET ORIENTATION P
IF p=1 OR p=3 THEN LET p=5
IF p=2 OR p=4 THEN LET p=6
SET ORIENTATION P
xmax=SCREEN_WIDTH()
ymax=SCREEN_HEIGHT()

draw font size 10
draw color 0,0,0

graphics mode normal
back=0.7
fill color back,back,back
fill rect 0,0 to xmax,ymax


c=0.5

graphics mode saturation
r=rnd(1)
g=rnd(1)
b=rnd(1)

fill color r,g,b
fill rect (xmax/2),(ymax/2) size 30,100

GET PIXEL xmax,ymax COLOR rr,gg,bb

graphics mode normal
draw text r at 10,10
draw text g at 10,20
draw text b at 10,30

draw text rr at 10,60
draw text gg at 10,70
draw text bb at 10,80

refresh

Post Reply