Рубрики

colorscolors red

Which two colors combine to form red?


Mixing colors program

Prompt: The colors red, blue, and yellow are known as the primary colors because they cannot be made by mixing other colors. When you mix two primary colors, you get a secondary color: When you mix red and blue, you get purple. When you mix red and yellow, you get orange. When you mix blue and yellow, you get green. Design a program that prompts the user to enter the names of two primary colors, one at a time. If the user enters anything other than “red,” “blue,” or “yellow,” the program should print “You didn’t input two primary colors.” Otherwise, it should print something in the format: “When you mix red and blue, you get purple.” (Assuming the user entered “red” and “blue”.) My program kept getting wrong standard output Here’s what I wrote:

primary_colora = input("Enter primary color:") primary_colorb = input("Enter primary color:") primary_colors = primary_colora or primary_colorb if primary_colora == (red, blue, yellow): primary_colora = True elif primary_colorb == (red, blue, yellow): primary_colorb = True elif primary_colors == red or blue: print("When you mix red and blue, you get purple") elif primary_colors == yellow or blue: print("When you mix yellow and blue, you get green") elif primary_colors == yellow or red: print("When you mix yellow and red, you get orange") else: print("You didn't input two primary colors.") 

Follow
asked Sep 18, 2015 at 20:48
Paul Bernella Paul Bernella
31 1 1 gold badge 4 4 silver badges 13 13 bronze badges

7 Answers 7

Sorted by: Reset to default

You need to change your statements to match the colors as strings and not as variables –

if primary_colora in ['red', 'blue', 'yellow']: 

Follow
answered Sep 18, 2015 at 20:50
Vikas Ojha Vikas Ojha
6,770 6 6 gold badges 22 22 silver badges 35 35 bronze badges

thats one of many problems . im pretty sure primary_colors = primary_colora or primary_colorb does not do what he thinks it does .




Colour Tertiary colours

Explore primary colours, secondary colours, and harmonious colours. Choices of colour and the relationships between colours have a huge influence on how a piece or art or design looks and feels and the emotions it provokes.

Part of Art and Design Elements of art

Add to My Bitesize Remove from My Bitesize

Tertiary colours

A tertiary colour is made by mixing equal amounts of a primary colour and a secondary colour together. There are six tertiary colours. On the colour wheel, they sit between the primary and secondary colour they are mixed from.

Colour wheel with tertiary colours. Orange yellow, orange red, purple red, purple blue, blue green, green yellow

  • Orange and yellow mix to make yellow-orange (this may also be referred to as amber)
  • Red and orange mix to make red-orange (this may be referred to as vermillion)
  • Purple and red mix to make red-purple (this may also be referred to as magenta)
  • Blue and purple mix to make blue-purple (this may also be referred to as violet)
  • Green and blue mix to make blue-green (this may also be referred to as turquoise or teal)
  • Yellow and green mix to make yellow-green (this may also be referred to as chartreuse or spring green)

Sometimes we have different names for the same colour. If you can’t remember all the names for thetertiary colours just use the basic ones like red-orange etc.

Woman with a Parasol, Paul Signac, 1893, oil on canvas, The Print Collector / Alamy Stock Photo

In Woman with Parasol (1893), Paul Signac creates a vibrant image based on tertiary colours.

Instead of mixing different colours of paint Signac applied small dabs of red-orange, blue-green, red-purple (and yellow) to his canvas. From a distance our eyes mix these to see different hues, tints and tones.

Using pure contrasting tertiary colours results in an intense, bright image.

Colin Wynn
the authorColin Wynn

Leave a Reply