Adding Colour To NKNavigation Controller

From NimbleKit

Jump to: navigation, search

[edit] To Colour A Navigation Bar

Firstly, pick a colour and get it's RGB value - either in photoshop etc or from a chart

Your html would be something like:

<html> 
<head> 
<meta name = "viewport" content = "width = 320,initial-scale = 1.0, user-scalable = no" /> <script type="text/javascript" src="NKit.js">
</script>
<script type="text/javascript">
var navController = new NKNavigationController(); 
navController.setTitle("Yummy Colours"); 
navController.setTintColor(0xFF, 0, 100); 
</script>
<a href="#" onClick="navController.gotoPage('page2.html')">Go To Page 2</a> 
</body> 
</html>


This line deals with the colour (and hence rgb values):

navController.setTintColor(r, g, b);

You enter your chosen colour - eg for an orangey red:

R - 153
G - 051
B - 017

you would use

navController.setTintColor(153, 051, 017);
Personal tools