Module: services/contributor-count

Common functions and utilities for tasks related to contributor count.

Source:

Methods

(inner) contributorColor(contributorCount) → {string}

Determines the color used for a badge based on the contributor count. The color varies from red to bright green as the contributor count increases.

Parameters:
Name Type Description
contributorCount number

Contributor count

Source:
Returns:

Badge color

Type
string

(inner) renderContributorBadge(attrs) → {object}

Handles rendering concerns of badges that display contributor count. Determines the message and color of the badge according to the contributor count.

Parameters:
Name Type Description
attrs object

Refer to individual attributes

Properties
Name Type Attributes Description
label string <optional>

If provided then badge label is set to this value

contributorCount number

Contributor count

Source:
Returns:

Badge with label, message and color properties

Type
object