These are the code samples for The Book of OpenLayer3. Feel free to download the source code and contribute to this repository:
The example shows how we style features using the so called style functions, which allows a fine degree of control of the style to be applied.