This rules out darker colors whose components can be closer to 0.
Color pastel code#
This code generates a random color whose red, green, and blue components are all between 128 and 256. For example instead of creating a completely random color, you could create a random color whose components are on the lighter side. The meaning of pastel is a paste made of powdered pigment ranging from pale to deep colors and used for making crayons also : a crayon made of such paste.
Is it just a lighter color? If so there are easier ways to generate that.
Whether that produces a pastel color depends on the parameter color, but I suppose if you passed in pure white then it would be like mixing a random color with white?Īnyway, I recommend you take a step back and think about exactly what you mean by pastel color. The colors within this palette can be described as soft, soothing, near neutral, and de-saturated. It looks to me like the function in your first code snippet is averaging a random color with the parameter color. /rebates/&.com252frembrandt-5-color-light-grays-half-stick-soft-pastel-set252fD368489S. Pastel colors are the family of colors with low to intermediary saturation and high value. The more white you add, the paler and softer it gets. PIGMENT decobrush Pastel Colors Collection containing 12 markers in an exclusive case for easy use and to protect the markers. For example, pale pink is red with a certain amount of white in it. If you're going to use code you find on the internet, it's really important that you understand what it's doing. Pastel colors, also known as tints, are the softer versions of primary and secondary colors obtained by adding white to the original color.