Giter Club home page Giter Club logo

nutriscorelogo's Introduction

NutriScoreLogo

This repository defines a class for a view, which shows the NutriScore logo. The class offers an instance variable, which sets the nutrition score.

The logo is scalable and adheres to autolayout.

Example

iPhone 5S demo

Demo

The repository contains a demo app, which shows you how the logo looks like in three different sizes. And you can set score for each of the five possible scores.

Usage

Copy the files NutriScore.xib and NutriScoreView.swift into your project.

Add a view to where you want to place the nutri-score. Set the view aspect ratio to 310:126. You can then size to what you want.

In the identity inspector set the Custom Class to NutriScoreView.

You can set the selected score by setting the instance variable currentScore = .A / .B / .C / .D / .E

Design considerations

Sizes

The current layout of the logo has been derived from an image found on the web and has the following characteristics:

  • Level size: 78 x 126
  • Score size: 58 x 194

Colours used

  • 006633 (dark green) with 339966 for letter A
  • 669900 (light green) with 99CC66 for letter B
  • FFCC00 (yellow) with FFFF66 for letter C
  • CC6600 (orange) with CC9966 for letter D
  • CC0000 (red) with FF9966 for letter E

nutriscorelogo's People

Contributors

aleene avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

tovkal

nutriscorelogo's Issues

Rotation support

After rotating the device the views are not updated.

I like to put everything in the storyboard (scalable fonts, scalable borders and scalable border widths)

Scaling

There is still an issue with scaling. It could do better for smaller sizes.

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.