Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transparent base color #23

Open
luisjakon opened this issue Mar 21, 2022 · 3 comments
Open

Transparent base color #23

luisjakon opened this issue Mar 21, 2022 · 3 comments
Labels
good first issue Good for newcomers

Comments

@luisjakon
Copy link

luisjakon commented Mar 21, 2022

Hello, is it possible to set a transparency level for the base color? Many thnxs!

@luisjakon luisjakon changed the title Inverting color scheme Transparent base color Mar 21, 2022
@shuding
Copy link
Owner

shuding commented Mar 23, 2022

This is currently not supported, but PRs are welcome!

@shuding shuding added the good first issue Good for newcomers label Mar 23, 2022
@bdtanbir
Copy link

bdtanbir commented Feb 6, 2024

@shuding, i want to change the baseColor but why it's not working? It's getting wrong color for some times.

`import createGlobe from "https://cdn.skypack.dev/cobe";

  let phi = 0;
  let canvas = document.getElementById("cobe");

  const globe = createGlobe(canvas, {
    devicePixelRatio: 1,
    width: 500,
    height: 500,
    phi: 0,
    theta: 0,
    dark: 0,
    diffuse: 1,
    scale: 1,
    mapSamples: 16000,
    mapBrightness: 12,
    baseColor: ["0", "170", "255"],
    markerColor: ["0", "170", "255"],
    glowColor: [1, 1, 1],
    backgroundColor: [255, 255, 255],
    opacity: 1,
    offset: [0, 0],
    markers: [],
    onRender: (state) => {
      // Called on every animation frame.
      // `state` will be an empty object, return updated params.
      state.phi = phi;
      phi += 0.01;
    },
  });`
Screenshot 2024-02-06 at 3 18 18 PM

is there problem with my codes?

@tuanrobo
Copy link

tuanrobo commented Jun 30, 2024

@shuding, i want to change the baseColor but why it's not working? It's getting wrong color for some times.

`import createGlobe from "https://cdn.skypack.dev/cobe";

  let phi = 0;
  let canvas = document.getElementById("cobe");

  const globe = createGlobe(canvas, {
    devicePixelRatio: 1,
    width: 500,
    height: 500,
    phi: 0,
    theta: 0,
    dark: 0,
    diffuse: 1,
    scale: 1,
    mapSamples: 16000,
    mapBrightness: 12,
    baseColor: ["0", "170", "255"],
    markerColor: ["0", "170", "255"],
    glowColor: [1, 1, 1],
    backgroundColor: [255, 255, 255],
    opacity: 1,
    offset: [0, 0],
    markers: [],
    onRender: (state) => {
      // Called on every animation frame.
      // `state` will be an empty object, return updated params.
      state.phi = phi;
      phi += 0.01;
    },
  });`

is there problem with my codes?

I figured out, baseColor: ["0", "170", "255"] => baseColor: [0/255, 177/255, 255/255]
P/S: Values should be numbers, not String

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

4 participants