The Database Hub | Back4App
The Database Hub | Back4App
How it works
  • Log In
  • Sign Up

  1. Back4App
  2. All Colors with Name and RGB
Public

119
120
119
120
  • DatabaseDatabase
  • GraphQL API PlaygroundAPI Playground
  • Get Started GuideGet Started
  • IssuesIssues
  • ContributorsContributors
  • Database
    Database
    Get Started Guide
    Get Started
    Issues
    Issues
    Contributors
    Contributors

Color RGB by Name

This GraphQL query fetches the RGB code of a color by its name.


0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
query ColorByName {
  colors(where: { name: { equalTo: "Black olive" } }) {
    results {
      name
      hexCode
      redHex
      greenHex
      blueHex
      redDecimal
      greenDecimal
      blueDecimal
      redFraction
      greenFraction
      blueFraction
    }
  }
}
{
  "data": {
    "colors": {
      "results": [
        {
          "name": "Black olive",
          "hexCode": "#3B3C36",
          "redHex": "3B",
          "greenHex": "3C",
          "blueHex": "36",
          "redDecimal": 59,
          "greenDecimal": 60,
          "blueDecimal": 54,
          "redFraction": 0.23,
          "greenFraction": 0.24,
          "blueFraction": 0.21
        }
      ]
    }
  }
}