Menu

Java Programming 1 Create Program Wich Takes Two Rgb Values Applies Special Function Call Q43783145

Java Programming

1. Create a program wich takes in two RGB values and appliesspecial function to them. We call these special functions blendmodes.

a. Apply the darken function shouold compare each red, green,and blue value and return the lower of the two. Ex (255,0,90) ->(158,0,90)

b. Apply the lighen function to the RGB values. The functionshould compare each red, green and blue value and return the higherof the two. Ex: (255, 0, 90) lighen (148, 84, 181) -> (255, 84,181)

c.  Apply the multiply function to the two RGB values.It worls in the following way:

i. Convert eath rgb value into a decimal by deviding by 255. Ex(255,0,90) -> (1.00, 0.00, 0.35)

ii. Multiply the first color’s red value to the second color’sred value. Ex (1.00, 0.00, 0.35) * (0.58, 0.33, 0.71) -> (0.58,0.00, 0.25).

iii. Convert the decimal back into an integer by multiplying by255. Hint: use the int function. Ex: (0.58, 0.00, 0.25) ->(148,0.64)

d. Apply the screen functon to the RGB values. It workssimillarly to the multiply function, except instead of multiplyingtwo values (a*b), it uses the following: screen(a,b) = (1-a) *(1-b)

ex: (255,0,90) and (158,84,181) -> (1.00, 0.00, 0.35) and(0.58, 0.33, 0.71) (1.00), 0.00, 0,35) sreen (0.58), 0.33, 0.71) =(1.00, 0.33, 0.81)

-> R: 1 – (1 – 1.00) * (1-0.58) = 1.00

-> G: 1 – (1 – 0.00) * (1-0.33) = 0.33

-> B: 1 – (1-0.35) * 1-0.71) = 0.81

-> 1.00, 0.33, 0.81) -> (255,84,207)

Expert Answer


Answer to Java Programming 1. Create a program wich takes in two RGB values and applies special function to them. We call these sp…

OR