Giter Site home page Giter Site logo

colorvisionproject-alyallmann's Introduction

Can you see this? If not you might qualify to be colorblind!

Description

This program can analyze a file with different colors and can display certain colors values. Eventually, it will identify what are color combinations that can be problematic for people who are color blind.

v0.2 Updates

I added the list of hex values that are similar and different from all the color choices. I added functions and vectors to complete the code for the next step of finding out the best options for colorblind people and how colors can look alike.

v1.0 Updates

For this part I added two files and created a class to distinguish the classes. I also added more code to eliminate certain colors that could clash with others that would make it hard for colorblind people to know which one is which.

Developer

Alyssa Allmann

Example

To run the program, give the following commands:

g++ --std=c++11 *.cpp -o cvp
./cvp

Here is an example of the program running:

cout << "Please enter the file to be opened:\n";
getline(cin,fileName);

C++ Guide

Variables and Data Types

I have used different variables like int and string to identify the different types of lines and amounts: string line= ""; int amount;

Console Input and Output

I have used a cout statement outputs to end with a certian line: cout << line[counter];

Decisions

I used an if statement liketo narrow down the hexadecimals and colors: if(line [counter] >= '0'&& line[counter] <= '9' || line[counter] >= 'a' && line[counter] <= 'f' || line[counter] >= 'A' && line[counter] <= 'F'){ cout << line[counter];

Iteration

I used a while loop when directing to find the pound sign. This allows the code to find the pound sign then followed by the color: while( !reader.eof()) { getline(reader,line); position = line.find("#");

File Input and Output

I used a cin input when asking for a spceifc file to open: getline(cin,fileName);

Arrays/Vectors

I have used the following code as a vector to sort through the list of possible hex values:

vector colorAnalyze(string counter, vector colorlist){ vector returnColors;

Functions

I used pass-by-reference to count and be able to change the amount of numbers/letters for the hex values. while(returnColors.size()<3){ if(colorlist.size()-index>6){ index=index+6; }else{ index=6-(colorlist.size()-index); } if(colorlist[index] != counter){

Classes

I added both public and private class to my code to hold the data of adding colors and also picking which ones are a compatiable. I also declared the different types of variables and data types in both files.: class color { private: string color; vector colorAnalyze;

public: void setColor(string); string getColor (); void addColor (char); int getColorCompleted (); };

colorvisionproject-alyallmann's People

Contributors

alyallmann avatar github-classroom[bot] avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.